cvs: php-src /tests/lang foreach_with_references_001.phpt

From: Date: Thu, 24 Jul 2003 13:21:54 +0000
Subject: cvs: php-src /tests/lang foreach_with_references_001.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-22776@lists.php.net to get a copy of this message
zeev Thu Jul 24 09:21:54 2003 EDT Added files: /php-src/tests/lang foreach_with_references_001.phpt Log: Add foreach() test with references Index: php-src/tests/lang/foreach_with_references_001.phpt +++ php-src/tests/lang/foreach_with_references_001.phpt --TEST-- foreach() with references --FILE-- <?php $arr = array(1 => "one", 2 => "two", 3 => "three"); foreach($arr as $key => $val) { $val = $key; } print_r($arr); foreach($arr as $key => &$val) { $val = $key; } print_r($arr); --EXPECT-- Array ( [1] => one [2] => two [3] => three ) Array ( [1] => 1 [2] => 2 [3] => 3 )

« previous php.cvs (#22776) next »