|  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 Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
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";
        print "No";


Add a Patch

Pull Requests

Add a Pull Request


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: Sun Jul 14 15:01:28 2024 UTC