| Revision 20119,
498 bytes
checked in by nanasess, 15 years ago
(diff) |
|
module 以下は svn:keywords を除外
|
-
Property svn:eol-style set to
LF
|
| 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.