From:             mo at nevali dot net
Operating system: FreeBSD 6
PHP version:      5.2.5
PHP Bug Type:     Arrays related
Bug description:  References to references triggers unwanted further references

Description:
------------
Some circumstances involving deep references into arrays can cause 
assignment of those arrays to always assign references instead of 
values.






Reproduce code:
---------------
Please see http://nevali.net/docs/array-refs-testcase.phps

Expected result:
----------------
The code should produce the following output:

Created foo, foo->thing['stuff'] = 1234
Creating Bar, foo->thing['stuff'] = 1234
Created bar, bar->thing2['stuff'] = ABC
Created bar, foo->thing['stuff'] = 1234






Actual result:
--------------
Created foo, foo->thing['stuff'] = 1234
Creating Bar, foo->thing['stuff'] = 1234
Created bar, bar->thing2['stuff'] = ABC
Created bar, foo->thing['stuff'] = ABC

If the (marked) line in Foo's constructor:

$this->stuff =& $this->thing['stuff'];

…is removed, the output is as expected, even though this code should be 
inert (Foo::stuff is not referenced from anywhere else in the test 
code).


 

-- 
Edit bug report at http://bugs.php.net/?id=44658&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44658&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44658&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44658&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44658&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=44658&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44658&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44658&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44658&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44658&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44658&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=44658&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=44658&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44658&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44658&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=44658&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44658&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44658&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44658&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44658&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44658&r=mysqlcfg

Reply via email to