#22994 [Opn->Bgs]: if ( $something == "NAME") { print $something } prints "0"

From: Date: Mon, 31 Mar 2003 23:02:13 +0000
Subject: #22994 [Opn->Bgs]: if ( $something == "NAME") { print $something } prints "0"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-36867@lists.php.net to get a copy of this message
ID: 22994 Updated by: rasmus@php.net Reported By: hermandepauw at hotmail dot com -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: Red Hat Linux PHP Version: 4.3.0 New Comment: Use === if you want to check both type and value. The numerical value of "NAME" is indeed 0, so if $something is 0 the condition will be true. Previous Comments: ------------------------------------------------------------------------ [2003-03-31 16:45:16] hermandepauw at hotmail dot com if ( $something == "NAME") { print $something } prints "0" the main problem is in the summary ... example code and source on http://www.deparadox.be/php/ i don't know the explain it in words so get a view ... code is only ~10 lines ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22994&edit=1

« previous php.bugs (#36867) next »