php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25292 is_null(1) and comparison with null produce different results
Submitted: 2003-08-28 08:24 UTC Modified: 2003-08-28 10:58 UTC
From: dizza at students dot ru Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.3 OS: FreeBSD 5.1
Private report: No CVE-ID: None
 [2003-08-28 08:24 UTC] dizza at students dot ru
Description:
------------
When calling is_null(1) for a varibale and compare it with 
null I get different result. 
Shouldn't it produce the same result? 

Reproduce code:
---------------
$arr = array();

echo( is_null( $arr ) ? "is_null: NULL\n" : "is_null: NOT NULL\n" );

echo( (null == $arr) ? "null: NULL\n" : "null: NOT NULL\n" );

Expected result:
----------------
is_not: NOT NULL 
null: NULL 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-28 10:58 UTC] sniper@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

*sigh x 2*

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 17:01:34 2025 UTC