ID: 30074 Comment by: t3 at rohms dot com 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:
I believe my problem may be related; I also filed a <a href="http://bugs.php.net/?id=31753">report</a> but not every isntance of extract() was causing problems. I was running 4.3.6 with no problems; upgraded to 4.3.10 and code didn't work; updated to latest version of zend; didn't work; downgraded back to 4.3.6, didn't work; downgraded to 4.3.6 and switched back to previous version of zend: worked. It seems that the new version of zend may be invovled in the problem. I wonder if turning down the optimization level would help? Previous Comments: ------------------------------------------------------------------------ [2005-01-19 22:10:26] [EMAIL PROTECTED] See also bug #31217 ------------------------------------------------------------------------ [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)); ?> ------------------------------------------------------------------------ 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