php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4765 $NULL / $null are equal to 0
Submitted: 2000-06-01 22:44 UTC Modified: 2000-06-02 12:16 UTC
From: nic at undiluted dot org Assigned:
Status: Closed Package: Other
PHP Version: 4.0.0 Release OS: linux kernel 2.2.14
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: nic at undiluted dot org
New email:
PHP Version: OS:

 

 [2000-06-01 22:44 UTC] nic at undiluted dot org
I was getting some error In a larger script I wrote which worked fine with php3..x.  For some reason thou I came to find out that $null or $NULL was equal to 0 for some reason.  I dont know if this was intended or not but if it wasn't that seems like a bug to me anyways.  Usually null is set to be equal to \0 maybe the \ is missing somewhere or something.  

here is a small script to try to see the results I got.
<?
$test = 0;
if ($test == $NULL)
        print "yes";
else
        print "No";
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-02 12:16 UTC] stas at cvs dot php dot net
It's 0 because it's unset. $NULL is no better and no worse than $foobar. Both are plain variables.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC