--TEST-- Test array_map() function : usage variations - null value for 'callback' argument --FILE-- getMessage(), "\n"; } echo "-- with empty array --\n"; try { var_dump( array_map(array(), $arr1, $arr2) ); } catch (TypeError $e) { echo $e->getMessage(), "\n"; } echo "Done"; ?> --EXPECT-- *** Testing array_map() : null value for 'callback' argument *** -- with null -- array(2) { [0]=> array(3) { [0]=> int(1) [1]=> string(3) "one" [2]=> float(1.1) } [1]=> array(3) { [0]=> int(2) [1]=> string(3) "two" [2]=> float(2.2) } } array(2) { [0]=> array(3) { [0]=> int(1) [1]=> string(3) "one" [2]=> float(1.1) } [1]=> array(3) { [0]=> int(2) [1]=> string(3) "two" [2]=> float(2.2) } } -- with unset variable -- array(2) { [0]=> array(3) { [0]=> int(1) [1]=> string(3) "one" [2]=> float(1.1) } [1]=> array(3) { [0]=> int(2) [1]=> string(3) "two" [2]=> float(2.2) } } -- with undefined variable -- array(2) { [0]=> int(1) [1]=> int(2) } -- with empty string -- array_map(): Argument #1 ($callback) must be a valid callback or null, function "" not found or invalid function name -- with empty array -- array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members Done