Revision 19792,
498 bytes
checked in by Seasoft, 13 years ago
(diff) |
#744(PHP4 互換用途ソースを将来的に切り捨てやすい仕組みづくり)
|
Line | |
---|
1 | --TEST-- |
---|
2 | Function -- array_walk_recursive |
---|
3 | --SKIPIF-- |
---|
4 | <?php if (function_exists('array_walk_recursive')) { echo 'skip'; } ?> |
---|
5 | --FILE-- |
---|
6 | <?php |
---|
7 | require_once 'PHP/Compat.php'; |
---|
8 | PHP_Compat::loadFunction('array_walk_recursive'); |
---|
9 | |
---|
10 | $sweet = array('a' => 'apple', 'b' => 'banana'); |
---|
11 | $fruits = array('sweet' => $sweet, 'sour' => 'lemon'); |
---|
12 | |
---|
13 | function test_print($item, $key) |
---|
14 | { |
---|
15 | echo "$key holds $item\n"; |
---|
16 | } |
---|
17 | |
---|
18 | array_walk_recursive($fruits, 'test_print'); |
---|
19 | ?> |
---|
20 | --EXPECT-- |
---|
21 | a holds apple |
---|
22 | b holds banana |
---|
23 | sour holds lemon |
---|
Note: See
TracBrowser
for help on using the repository browser.