#37892 [Opn->Bgs]: $obj != null is incorrectly evaluated

From: Date: Thu, 22 Jun 2006 18:56:39 +0000
Subject: #37892 [Opn->Bgs]: $obj != null is incorrectly evaluated
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-98676@lists.php.net to get a copy of this message
ID: 37892 Updated by: tony2001@php.net Reported By: randy at rcs-comp dot com -Status: Open +Status: Bogus Bug Type: *General Issues Operating System: Win XP Pro PHP Version: 5CVS-2006-06-22 (snap) New Comment: Duplicate of #37806. Previous Comments: ------------------------------------------------------------------------ [2006-06-22 18:29:05] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37892&edit=1

« previous php.bugs (#98676) next »