#47067 [Opn]: NULL is set or unset value?

From: Date: Sun, 11 Jan 2009 10:57:54 +0000
Subject: #47067 [Opn]: NULL is set or unset value?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-132744@lists.php.net to get a copy of this message
ID: 47067 User updated by: farkow at gmail dot com Reported By: farkow at gmail dot com Status: Open Bug Type: Unknown/Other Function Operating System: Windows/WAMP Server PHP Version: 5.2.8 New Comment: In description, i used a wrong word, sorry for my English. It is not 'integer', i mean 'variable'. Previous Comments: ------------------------------------------------------------------------ [2009-01-11 10:44:36] farkow at gmail dot com Description: ------------ I realized it when i try someting about my web-based game, when you set an integer NULL, it is same with 0 and ''. Reproduce code: --------------- <?php $x = NULL; if($x == 0) echo 'UPPS 1<br>'; if($x == '') echo 'UPPS 2<br>'; if($x === '') echo 'UPPS 3<br>'; ?> Expected result: ---------------- //output Actual result: -------------- //output UPPS 1 UPPS 2 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47067&edit=1

« previous php.bugs (#132744) next »