--TEST-- Test array_walk_recursive() function : usage variations - 'input' argument as diff. associative arrays --FILE-- array(1 => 25, 5 => 12, 0 => -80), 1 => array(-2 => 100, 5 => 30)); echo "-- Associative array with numeric keys --\n"; var_dump( array_walk_recursive($input, "for_numeric", 10)); // String keys $input = array( "a" => "Apple", 'z' => array('b' => 'Bananna', "c" => "carrot"), 'x' => array('o' => "Orange")); echo "-- Associative array with string keys --\n"; var_dump( array_walk_recursive($input, "for_string")); // binary key $input = array( b"a" => "Apple", b"b" => "Banana"); echo "-- Associative array with binary keys --\n"; var_dump( array_walk_recursive($input, "for_string")); // Mixed keys - numeric/string $input = array( 0 => array(0 => 1, 1 => 2), "x" => array("a" => "Apple", "b" => "Banana"), 2 =>3); echo "-- Associative array with numeric/string keys --\n"; var_dump( array_walk_recursive($input, "for_mixed")); echo "Done" ?> --EXPECT-- *** Testing array_walk_recursive() : 'input' as an associative array *** -- Associative array with numeric keys -- int(1) int(25) int(10) int(5) int(12) int(10) int(0) int(-80) int(10) int(-2) int(100) int(10) int(5) int(30) int(10) bool(true) -- Associative array with string keys -- string(1) "a" string(5) "Apple" string(1) "b" string(7) "Bananna" string(1) "c" string(6) "carrot" string(1) "o" string(6) "Orange" bool(true) -- Associative array with binary keys -- string(1) "a" string(5) "Apple" string(1) "b" string(6) "Banana" bool(true) -- Associative array with numeric/string keys -- int(0) int(1) int(1) int(2) string(1) "a" string(5) "Apple" string(1) "b" string(6) "Banana" int(2) int(3) bool(true) Done