@@ -16,7 +16,6 @@ function callback2($value, $key, $user_data1, $user_data2) {
1616}
1717echo "*** Testing array_walk_recursive() : error conditions - callback parameters *** \n" ;
1818
19- // expected: Missing argument Warning
2019try {
2120 var_dump ( array_walk_recursive ($ input , "callback1 " ) );
2221} catch (Throwable $ e ) {
2827 echo "Exception: " . $ e ->getMessage () . "\n" ;
2928}
3029
31- // expected: Warning is suppressed
32- try {
33- var_dump ( @array_walk_recursive ($ input , "callback1 " ) );
34- } catch (Throwable $ e ) {
35- echo "Exception: " . $ e ->getMessage () . "\n" ;
36- }
37- try {
38- var_dump ( @array_walk_recursive ($ input , "callback2 " , 4 ) );
39- } catch (Throwable $ e ) {
40- echo "Exception: " . $ e ->getMessage () . "\n" ;
41- }
42-
4330echo "-- Testing array_walk_recursive() function with too many callback parameters -- \n" ;
4431try {
4532 var_dump ( array_walk_recursive ($ input , "callback1 " , 20 , 10 ) );
@@ -53,8 +40,6 @@ echo "Done";
5340*** Testing array_walk_recursive() : error conditions - callback parameters ***
5441Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected
5542Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected
56- Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected
57- Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected
5843-- Testing array_walk_recursive() function with too many callback parameters --
5944Exception: array_walk_recursive() expects at most 3 arguments, 4 given
6045Done
0 commit comments