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
)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php