mirror of
https://github.com/php/php-src.git
synced 2025-01-08 20:17:28 +08:00
b6b8bf0010
and add test for it
27 lines
344 B
PHP
27 lines
344 B
PHP
--TEST--
|
|
Test array_walk_recursive()
|
|
--FILE--
|
|
<?php
|
|
function foo($value) {
|
|
echo $value . " foo\n";
|
|
}
|
|
|
|
function bar($value) {
|
|
echo $value . " bar\n";
|
|
}
|
|
|
|
$arr = array (1,2,3);
|
|
var_dump (array_walk_recursive ($arr, 'foo'));
|
|
var_dump (array_walk_recursive ($arr, 'bar'));
|
|
|
|
?>
|
|
--EXPECTF--
|
|
1 foo
|
|
2 foo
|
|
3 foo
|
|
bool(true)
|
|
1 bar
|
|
2 bar
|
|
3 bar
|
|
bool(true)
|