array_walk() problem
| From: | Andrey Zmievski | Date: | Thu, 22 Jul 1999 14:25:51 +0000 |
| Subject: | array_walk() problem | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-2525@lists.php.net to get a copy of this message | ||
Currently, array_walk() is broken. If you try to run the following script,
you'll get "Unsupported operand types" error.
<?
function walk($val) {
$val *= 2;
}
$ar = array(1, 2, 3);
array_walk($ar, "walk");
var_dump($ar);
?>
The fix is trivial, but the result is that it's no longer possible to modify
array values inside the walk function. Is there any way around it? Zeev?
-Andrey
"Later in this talk, I intend to define
the universe and give three examples." -- Larry Wall