php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47067 NULL is set or unset value?
Submitted: 2009-01-11 10:44 UTC Modified: 2009-01-11 13:34 UTC
From: farkow at gmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.2.8 OS: Windows/WAMP Server
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: farkow at gmail dot com
New email:
PHP Version: OS:

 

 [2009-01-11 10:44 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-11 10:57 UTC] farkow at gmail dot com
In description, i used a wrong word, sorry for my English.
It is not 'integer', i mean 'variable'.
 [2009-01-11 13:34 UTC] colder@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

That's expected, please check out:
http://php.net/types.comparisons
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 23:01:33 2025 UTC