1--TEST-- 2preg_replace_callback_array() errors 3--FILE-- 4<?php 5 6function b() { 7 return "b"; 8} 9 10// empty strings 11 12var_dump(preg_replace_callback_array( 13 array( 14 "/a/" => 'b', 15 "" => function () { return "ok"; }), 'a')); 16 17var_dump(preg_replace_callback_array( 18 array( 19 "/a/" => 'b', 20 null => function () { return "ok"; }), 'a')); 21 22// backslashes 23 24var_dump(preg_replace_callback_array( 25 array( 26 "/a/" => 'b', 27 "\\b\\" => function () { return "ok"; }), 'a')); 28 29// alphanumeric delimiters 30 31var_dump(preg_replace_callback_array( 32 array( 33 "/a/" => 'b', 34 "aba" => function () { return "ok"; }), 'a')); 35 36var_dump(preg_replace_callback_array( 37 array( 38 "/a/" => 'b', 39 "1b1" => function () { return "ok"; }), 'a')); 40 41// null character delimiter 42 43var_dump(preg_replace_callback_array( 44 array( 45 "/a/" => 'b', 46 "\0b\0" => function () { return "ok"; }), 'a')); 47 48?> 49--EXPECTF-- 50Warning: preg_replace_callback_array(): Empty regular expression in %spreg_replace_callback_array_error.php on line %d 51NULL 52 53Warning: preg_replace_callback_array(): Empty regular expression in %spreg_replace_callback_array_error.php on line %d 54NULL 55 56Warning: preg_replace_callback_array(): Delimiter must not be alphanumeric, backslash, or NUL in %spreg_replace_callback_array_error.php on line %d 57NULL 58 59Warning: preg_replace_callback_array(): Delimiter must not be alphanumeric, backslash, or NUL in %spreg_replace_callback_array_error.php on line %d 60NULL 61 62Warning: preg_replace_callback_array(): Delimiter must not be alphanumeric, backslash, or NUL in %spreg_replace_callback_array_error.php on line %d 63NULL 64 65Warning: preg_replace_callback_array(): Delimiter must not be alphanumeric, backslash, or NUL in %spreg_replace_callback_array_error.php on line %d 66NULL