ID: 30074 Updated by: [EMAIL PROTECTED] Reported By: owen dot beresford at murphx dot com Status: Open Bug Type: Zend Engine 2 problem Operating System: linux PHP Version: 5.0.1 New Comment:
See also bug #31217 Previous Comments: ------------------------------------------------------------------------ [2004-12-20 22:29:39] mikael at SPAMMENOTchl dot chalmers dot se My bad, seems it was actually introduced in 4.3.9 by the fix for bug #29493. Then the question is; if it is a feature or a bug, it certainly breaks a lot of old unit tests/code for me. ------------------------------------------------------------------------ [2004-12-20 22:09:23] mikael at SPAMMENOTchl dot chalmers dot se That should read "I belive this bug was backported into PHP 4.3.10", it seems to be present in the newly released 4.3.10 but not in 4.3.9 ------------------------------------------------------------------------ [2004-12-20 22:07:41] mikael at SPAMMENOTchl dot chalmers dot se I belive this bug was introduced in PHP 4.3.10, it would seem that when doing EXTR_REFS $a in the example below isn't SEPARATE_ZVAL_TO_MAKE_IS_REF or something when being extracted from the array. Reproduce code: ------------ $a = 1; $b = 1; $arr = array('acopy' => $a, 'bref' => &$b); extract($arr, EXTR_REFS); $acopy++; $bref++; debug_zval_dump($a, $b, $arr, $acopy, $bref); Expected result (As seen on PHP < 4.3.10): ------------ $a: long(1) refcount(2) $b: long(2) refcount(1) $arr: array(2) refcount(2){ ["acopy"]=> &long(2) refcount(2) ["bref"]=> &long(2) refcount(3) } $acopy: long(2) refcount(1) $bref: long(2) refcount(1) Actual result: -------------- $a: long(2) refcount(1) $b: long(2) refcount(1) $arr: array(2) refcount(2){ ["acopy"]=> &long(2) refcount(3) ["bref"]=> &long(2) refcount(3) } $acopy: long(2) refcount(1) $bref: long(2) refcount(1) ------------------------------------------------------------------------ [2004-11-28 16:34:08] [EMAIL PROTECTED] Reduced reproduce code looks like this: <?php $result = extract(array('a'=>1, 'b'=>$foo), EXTR_REFS); //extract(array('a'=>1, 'b'=>$foo), EXTR_REFS); // they are not the same var_dump(array($b)); ?> ------------------------------------------------------------------------ [2004-09-14 11:10:56] owen dot beresford at murphx dot com I have noticed my code output has the wrong indexes. the expected out put should read index 0 and index 1 not index 'a', index 'b' bug still present ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/30074 -- Edit this bug report at http://bugs.php.net/?id=30074&edit=1