From:             [EMAIL PROTECTED]
Operating system: Linux Redhat 6.2
PHP version:      4.0.4pl1
PHP Bug Type:     Scripting Engine problem
Bug description:  weird behaviour with references and foreach

<?php
echo "<small><pre>";

/* for some reason the following code magically kills
   an array value, or better, overwrites it with another one.
   might be related to bug #6417 */

$arr = array('a','b');
$ref =& $arr[0];

print_r($arr);
/* gives: Array ( [0] => a [1] => b ) */

foreach($arr as $ref);
print_r($arr);

/* gives: Array ( [0] => b [1] => b ) */
?>



-- 
Edit Bug report at: http://bugs.php.net/?id=11541&edit=1



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to