#36487 [NEW]: object === same object mismatch

From: Date: Wed, 22 Feb 2006 13:33:20 +0000
Subject: #36487 [NEW]: object === same object mismatch
Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-2427@lists.php.net to get a copy of this message
From: xxoes at nw7 dot de Operating system: windows & linux PHP version: 5.1.2 PHP Bug Type: PHP-GTK related Bug description: object === same object mismatch Description: ------------ Although the objects have the same object id after destruction, "===" doesn't equal them any more. I try: $abc = new abc(); $obj = new bla(); and: $abc = new abc(); $obj = new bla(); both the same result. This does not happen when you remove "extends GtkObject" from the class signature. Reproduce code: --------------- <?PHP class bla extends GtkObject { public $xparent; function __construct() { } function __destruct() { echo "bla::__destruct()\r\n"; $this->xparent->remove($this); } } class abc { function __destruct() { echo "abc::__destruct()\r\n"; } function put($obj) { $this->obj = $obj; $obj->xparent = $this; } function remove($obj) { echo "Object matched?: ".($this->obj === $obj)."\r\n"; echo $this->obj." ".$obj."\r\n"; } } $abc = new abc(); $obj = new bla(); $abc->put($obj); ?> Expected result: ---------------- That the operation $this->obj === $obj is true. Actual result: -------------- $this->obj and $obj mismatch. -- Edit bug report at http://bugs.php.net/?id=36487&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36487&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36487&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36487&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36487&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36487&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36487&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=36487&r=needscript Try newer version: http://bugs.php.net/fix.php?id=36487&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36487&r=support Expected behavior: http://bugs.php.net/fix.php?id=36487&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36487&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36487&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36487&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36487&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36487&r=dst IIS Stability: http://bugs.php.net/fix.php?id=36487&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36487&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36487&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36487&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=36487&r=mysqlcfg

« previous php.gtk.dev (#2427) next »