#28892 [NEW]: Object id that's still in use gets reassigned
| From: | paranoid at pcwereld dot be | Date: | Wed, 23 Jun 2004 10:59:05 +0000 |
| Subject: | #28892 [NEW]: Object id that's still in use gets reassigned | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-61278@lists.php.net to get a copy of this message | ||
From: paranoid at pcwereld dot be
Operating system: Windows 2k
PHP version: 5.0.0RC3
PHP Bug Type: Zend Engine 2 problem
Bug description: Object id that's still in use gets reassigned
Description:
------------
PHP reassigns an allready-in-use object id to a newly created object,
after the first object (that loses it's id) was removed from an array, but
was still referenced in another object.
Reproduce code:
---------------
http://users.pandora.be/paranet/poc.html
Expected result:
----------------
I expected that object C would still contain a reference to the first A
object (A-1) i created, ...
Actual result:
--------------
(see comments in code for the actual output)
... instead A-1 was overwritten with a second A object (A-2) i created,
that (!!!!!) used the same object id as the first A object.
PHP seems to be missing the fact that A-1 is still referenced inside the C
object, and thus assigns the object id A-1 was using to A-2
Removing the part marked "important" in list_remove results in a normal
behaviour, eg. C refers to A-1, not A-2. And A-2 doesn't get the same
object id as A-1. The bug is probably somewhere in the code that removes
an object from an array.
--
Edit bug report at http://bugs.php.net/?id=28892&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28892&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28892&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28892&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28892&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28892&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28892&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28892&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28892&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28892&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28892&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28892&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28892&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28892&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28892&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28892&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28892&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28892&r=float