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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Apr 19 23:01:28 2024 UTC