From 1981dd9c73ada7ea893b4636b84211f68838ba23 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 11 Sep 2014 11:06:57 +0400 Subject: Revert "Removing ext/ereg and dependencies" This reverts commit 86de7963fe69638431c0aa8f413d25e01bf99d68. --- ext/ereg/tests/split_variation_003.phpt | 231 ++++++++++++++++++++++++++++++++ 1 file changed, 231 insertions(+) create mode 100644 ext/ereg/tests/split_variation_003.phpt (limited to 'ext/ereg/tests/split_variation_003.phpt') diff --git a/ext/ereg/tests/split_variation_003.phpt b/ext/ereg/tests/split_variation_003.phpt new file mode 100644 index 0000000000..edef9cfeb9 --- /dev/null +++ b/ext/ereg/tests/split_variation_003.phpt @@ -0,0 +1,231 @@ +--TEST-- +Test split() function : usage variations - unexpected type for arg 3 +--FILE-- + 'red', 'item' => 'pen'), + + // null data + NULL, + null, + + // boolean data + true, + false, + TRUE, + FALSE, + + // empty data + "", + '', + + // string data + "string", + 'string', + + // object data + new stdclass(), + + // undefined data + @$undefined_var, + + // unset data + @$unset_var, +); + +// loop through each element of the array for limit + +foreach($values as $value) { + echo "\nArg value $value \n"; + var_dump( split($pattern, $string, $value) ); +}; + +echo "Done"; +?> +--EXPECTF-- +*** Testing split() : usage variations *** + +Arg value 10.5 +Error: 8192 - Function split() is deprecated, %s(73) +array(5) { + [0]=> + string(1) "1" + [1]=> + string(1) "2" + [2]=> + string(1) "3" + [3]=> + string(1) "4" + [4]=> + string(1) "5" +} + +Arg value -10.5 +Error: 8192 - Function split() is deprecated, %s(73) +array(1) { + [0]=> + string(9) "1 2 3 4 5" +} + +Arg value 1.07654321E-9 +Error: 8192 - Function split() is deprecated, %s(73) +array(1) { + [0]=> + string(9) "1 2 3 4 5" +} + +Arg value 0.5 +Error: 8192 - Function split() is deprecated, %s(73) +array(1) { + [0]=> + string(9) "1 2 3 4 5" +} +Error: 8 - Array to string conversion, %ssplit_variation_003.php(%d) + +Arg value Array +Error: 8192 - Function split() is deprecated, %s(73) +Error: 2 - split() expects parameter 3 to be long, array given, %s(73) +NULL +Error: 8 - Array to string conversion, %ssplit_variation_003.php(%d) + +Arg value Array +Error: 8192 - Function split() is deprecated, %s(73) +Error: 2 - split() expects parameter 3 to be long, array given, %s(73) +NULL +Error: 8 - Array to string conversion, %ssplit_variation_003.php(%d) + +Arg value Array +Error: 8192 - Function split() is deprecated, %s(73) +Error: 2 - split() expects parameter 3 to be long, array given, %s(73) +NULL +Error: 8 - Array to string conversion, %ssplit_variation_003.php(%d) + +Arg value Array +Error: 8192 - Function split() is deprecated, %s(73) +Error: 2 - split() expects parameter 3 to be long, array given, %s(73) +NULL +Error: 8 - Array to string conversion, %ssplit_variation_003.php(%d) + +Arg value Array +Error: 8192 - Function split() is deprecated, %s(73) +Error: 2 - split() expects parameter 3 to be long, array given, %s(73) +NULL + +Arg value +Error: 8192 - Function split() is deprecated, %s(73) +array(1) { + [0]=> + string(9) "1 2 3 4 5" +} + +Arg value +Error: 8192 - Function split() is deprecated, %s(73) +array(1) { + [0]=> + string(9) "1 2 3 4 5" +} + +Arg value 1 +Error: 8192 - Function split() is deprecated, %s(73) +array(1) { + [0]=> + string(9) "1 2 3 4 5" +} + +Arg value +Error: 8192 - Function split() is deprecated, %s(73) +array(1) { + [0]=> + string(9) "1 2 3 4 5" +} + +Arg value 1 +Error: 8192 - Function split() is deprecated, %s(73) +array(1) { + [0]=> + string(9) "1 2 3 4 5" +} + +Arg value +Error: 8192 - Function split() is deprecated, %s(73) +array(1) { + [0]=> + string(9) "1 2 3 4 5" +} + +Arg value +Error: 8192 - Function split() is deprecated, %s(73) +Error: 2 - split() expects parameter 3 to be long, string given, %s(73) +NULL + +Arg value +Error: 8192 - Function split() is deprecated, %s(73) +Error: 2 - split() expects parameter 3 to be long, string given, %s(73) +NULL + +Arg value string +Error: 8192 - Function split() is deprecated, %s(73) +Error: 2 - split() expects parameter 3 to be long, string given, %s(73) +NULL + +Arg value string +Error: 8192 - Function split() is deprecated, %s(73) +Error: 2 - split() expects parameter 3 to be long, string given, %s(73) +NULL +Error: 4096 - Object of class stdClass could not be converted to string, %s(72) + +Arg value +Error: 8192 - Function split() is deprecated, %s(73) +Error: 2 - split() expects parameter 3 to be long, object given, %s(73) +NULL + +Arg value +Error: 8192 - Function split() is deprecated, %s(73) +array(1) { + [0]=> + string(9) "1 2 3 4 5" +} + +Arg value +Error: 8192 - Function split() is deprecated, %s(73) +array(1) { + [0]=> + string(9) "1 2 3 4 5" +} +Done \ No newline at end of file -- cgit v1.2.1