php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37892 $obj != null is incorrectly evaluated
Submitted: 2006-06-22 18:29 UTC Modified: 2006-06-22 18:56 UTC
From: randy at rcs-comp dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5CVS-2006-06-22 (snap) OS: Win XP Pro
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: randy at rcs-comp dot com
New email:
PHP Version: OS:

 

 [2006-06-22 18:29 UTC] randy at rcs-comp dot com
Description:
------------
When evaluating an instantiated object with "!=" the result is incorreclty returned as false;

Reproduce code:
---------------
echo phpversion();
class foo {
    var $test;
}

$obj = new foo();

if( $obj != null ) {
    echo "\n\ncorrect";
} else {
    echo "\n\nnot correct";
}

Expected result:
----------------
D:\tmp>"c:\Program Files\PHP514\php.exe" obj_null.php
5.1.4

correct

Actual result:
--------------
D:\tmp>php obj_null.php
5.2.0-dev

not correct

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-22 18:56 UTC] tony2001@php.net
Duplicate of #37806.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC