note 68283 deleted from language.references.whatdo by nlopess

From: Date: Thu, 20 Jul 2006 17:19:54 +0000
Subject: note 68283 deleted from language.references.whatdo by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-114983@lists.php.net to get a copy of this message
Note Submitter: dexen ^ goofy*pl ---- PHP Version 4.4.2 Anybody care to explain? <?php $a = array( 'X'=>'XX', 'Y'=>'YY' ); $a['a'] =& $a; // $b = $a; foreach ( $a as $k) { print $k.'<br />'; } print_r( $a ); ?> gives: XX YY Array Array ( [X] => XX [Y] => YY [a] => Array *RECURSION* ) -------------------- However, <?php $a = array( 'X'=>'XX', 'Y'=>'YY' ); $a['a'] =& $a; $b = $a; foreach ( $a as $k) { print $k.'<br />'; } print_r( $a ); ?> outputs: XX YY Array Array ( [X] => XX [Y] => YY [a] => Array ( [X] => XX [Y] => YY [a] => Array *RECURSION* ) )

« previous php.notes (#114983) next »