diff options
Diffstat (limited to 'ext/ereg/tests')
75 files changed, 0 insertions, 7552 deletions
diff --git a/ext/ereg/tests/001.phpt b/ext/ereg/tests/001.phpt deleted file mode 100644 index 0ba697978c..0000000000 --- a/ext/ereg/tests/001.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -RegReplace test 1 ---FILE-- -<?php $a="abc123"; - echo ereg_replace("123","def",$a)?> ---EXPECTF-- -Deprecated: Function ereg_replace() is deprecated in %s on line %d -abcdef diff --git a/ext/ereg/tests/002.phpt b/ext/ereg/tests/002.phpt deleted file mode 100644 index 6ce12a936a..0000000000 --- a/ext/ereg/tests/002.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -RegReplace test 2 ---FILE-- -<?php $a="abc123"; - echo ereg_replace("123","",$a)?> ---EXPECTF-- -Deprecated: Function ereg_replace() is deprecated in %s on line %d -abc diff --git a/ext/ereg/tests/003.phpt b/ext/ereg/tests/003.phpt deleted file mode 100644 index 5431349fa9..0000000000 --- a/ext/ereg/tests/003.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -ereg_replace single-quote test ---FILE-- -<?php $a="\\'test"; - echo ereg_replace("\\\\'","'",$a) -?> ---EXPECTF-- -Deprecated: Function ereg_replace() is deprecated in %s on line %d -'test diff --git a/ext/ereg/tests/004.phpt b/ext/ereg/tests/004.phpt deleted file mode 100644 index db16fe1471..0000000000 --- a/ext/ereg/tests/004.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -simple ereg test ---FILE-- -<?php $a="This is a nice and simple string"; - if (ereg(".*nice and simple.*",$a)) { - echo "ok\n"; - } - if (!ereg(".*doesn't exist.*",$a)) { - echo "ok\n"; - } -?> ---EXPECTF-- -Deprecated: Function ereg() is deprecated in %s on line %d -ok - -Deprecated: Function ereg() is deprecated in %s on line %d -ok diff --git a/ext/ereg/tests/005.phpt b/ext/ereg/tests/005.phpt deleted file mode 100644 index 127ede0c49..0000000000 --- a/ext/ereg/tests/005.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Test Regular expression register support in ereg ---FILE-- -<?php $a="This is a nice and simple string"; - echo ereg(".*(is).*(is).*",$a,$registers); - echo "\n"; - echo $registers[0]; - echo "\n"; - echo $registers[1]; - echo "\n"; - echo $registers[2]; - echo "\n"; -?> ---EXPECTF-- -Deprecated: Function ereg() is deprecated in %s on line %d -32 -This is a nice and simple string -is -is diff --git a/ext/ereg/tests/006.phpt b/ext/ereg/tests/006.phpt deleted file mode 100644 index 7df88dd321..0000000000 --- a/ext/ereg/tests/006.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Test ereg_replace of start-of-line ---FILE-- -<?php $a="This is a nice and simple string"; - echo ereg_replace("^This","That",$a); -?> ---EXPECTF-- -Deprecated: Function ereg_replace() is deprecated in %s on line %d -That is a nice and simple string diff --git a/ext/ereg/tests/007.phpt b/ext/ereg/tests/007.phpt deleted file mode 100644 index 3bbd6551b6..0000000000 --- a/ext/ereg/tests/007.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Test empty result buffer in reg_replace ---FILE-- -<?php - $a="abcd"; - $b=ereg_replace("abcd","",$a); - echo "strlen(\$b)=".strlen($b); -?> ---EXPECTF-- -Deprecated: Function ereg_replace() is deprecated in %s on line %d -strlen($b)=0 diff --git a/ext/ereg/tests/008.phpt b/ext/ereg/tests/008.phpt deleted file mode 100644 index ad34ba3978..0000000000 --- a/ext/ereg/tests/008.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Test back-references in regular expressions ---FILE-- -<?php - echo ereg_replace("([a-z]*)([-=+|]*)([0-9]+)","\\3 \\1 \\2\n","abc+-|=123"); -?> ---EXPECTF-- -Deprecated: Function ereg_replace() is deprecated in %s on line %d -123 abc +-|= diff --git a/ext/ereg/tests/009.phpt b/ext/ereg/tests/009.phpt deleted file mode 100644 index 513f31a83e..0000000000 --- a/ext/ereg/tests/009.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Test split() ---FILE-- -<?php - $a=split("[[:space:]]","this is a -test"); - echo count($a) . "\n"; - for ($i = 0; $i < count($a); $i++) { - echo $a[$i] . "\n"; - } -?> ---EXPECTF-- -Deprecated: Function split() is deprecated in %s on line %d -4 -this -is -a -test diff --git a/ext/ereg/tests/010.phpt b/ext/ereg/tests/010.phpt deleted file mode 100644 index 52a3e3bb1c..0000000000 --- a/ext/ereg/tests/010.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Long back references ---FILE-- -<?php $a="abc122222222223"; - echo ereg_replace("1(2*)3","\\1def\\1",$a)?> ---EXPECTF-- -Deprecated: Function ereg_replace() is deprecated in %s on line %d -abc2222222222def2222222222 diff --git a/ext/ereg/tests/011.phpt b/ext/ereg/tests/011.phpt deleted file mode 100644 index 8bd51b467a..0000000000 --- a/ext/ereg/tests/011.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -\0 back reference ---FILE-- -<?php $a="abc123"; - echo ereg_replace("123","def\\0ghi",$a)?> ---EXPECTF-- -Deprecated: Function ereg_replace() is deprecated in %s on line %d -abcdef123ghi diff --git a/ext/ereg/tests/012.phpt b/ext/ereg/tests/012.phpt deleted file mode 100644 index d54ae01f12..0000000000 --- a/ext/ereg/tests/012.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -nonexisting back reference ---FILE-- -<?php $a="abc123"; - echo ereg_replace("123",'def\1ghi',$a)?> ---EXPECTF-- -Deprecated: Function ereg_replace() is deprecated in %s on line %d -abcdef\1ghi diff --git a/ext/ereg/tests/013.phpt b/ext/ereg/tests/013.phpt deleted file mode 100644 index 23f6944ff5..0000000000 --- a/ext/ereg/tests/013.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -escapes in replace string ---FILE-- -<?php $a="abc123"; - echo ereg_replace("123","def\\g\\\\hi\\",$a)?> ---EXPECTF-- -Deprecated: Function ereg_replace() is deprecated in %s on line %d -abcdef\g\\hi\ diff --git a/ext/ereg/tests/014.phpt b/ext/ereg/tests/014.phpt deleted file mode 100644 index ac68802061..0000000000 --- a/ext/ereg/tests/014.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -backreferences not replaced recursively ---FILE-- -<?php $a="a\\2bxc"; - echo ereg_replace("a(.*)b(.*)c","\\1",$a)?> ---EXPECTF-- -Deprecated: Function ereg_replace() is deprecated in %s on line %d -\2 diff --git a/ext/ereg/tests/015.phpt b/ext/ereg/tests/015.phpt deleted file mode 100644 index edb8e709c6..0000000000 --- a/ext/ereg/tests/015.phpt +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -replace empty matches ---FILE-- -<?php echo ereg_replace("^","z","abc123")?> ---EXPECTF-- -Deprecated: Function ereg_replace() is deprecated in %s on line %d -zabc123 diff --git a/ext/ereg/tests/016.phpt b/ext/ereg/tests/016.phpt deleted file mode 100644 index 93dbda7ee5..0000000000 --- a/ext/ereg/tests/016.phpt +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -test backslash handling in regular expressions ---FILE-- -<?php echo ereg_replace('\?',"abc","?123?")?> ---EXPECTF-- -Deprecated: Function ereg_replace() is deprecated in %s on line %d -abc123abc diff --git a/ext/ereg/tests/ereg_basic_001.phpt b/ext/ereg/tests/ereg_basic_001.phpt deleted file mode 100644 index e9dad37636..0000000000 --- a/ext/ereg/tests/ereg_basic_001.phpt +++ /dev/null @@ -1,153 +0,0 @@ ---TEST-- -Test ereg() function : basic functionality (with $regs) ---FILE-- -<?php -/* Prototype : proto int ereg(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test a number of simple, valid matches with ereg, specifying $regs - */ - -echo "*** Testing ereg() : basic functionality ***\n"; - -include(dirname(__FILE__) . '/regular_expressions.inc'); - -foreach ($expressions as $re) { - list($pattern,$string) = $re; - echo "--> Pattern: '$pattern'; string: '$string'\n"; - var_dump(ereg($pattern, $string, $regs)); - var_dump($regs); -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg() : basic functionality *** ---> Pattern: '..(a|b|c)(a|b|c)..'; string: '--- ab ---' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(6) -array(3) { - [0]=> - string(6) "- ab -" - [1]=> - string(1) "a" - [2]=> - string(1) "b" -} ---> Pattern: '()'; string: '' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) -array(2) { - [0]=> - bool(false) - [1]=> - bool(false) -} ---> Pattern: '()'; string: 'abcdef' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) -array(2) { - [0]=> - bool(false) - [1]=> - bool(false) -} ---> Pattern: '[x]|[^x]'; string: 'abcdef' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) -array(1) { - [0]=> - string(1) "a" -} ---> Pattern: '(a{1})(a{1,}) (b{1,3}) (c+) (d?ddd|e)'; string: '--- aaa bbb ccc ddd ---' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(15) -array(6) { - [0]=> - string(15) "aaa bbb ccc ddd" - [1]=> - string(1) "a" - [2]=> - string(2) "aa" - [3]=> - string(3) "bbb" - [4]=> - string(3) "ccc" - [5]=> - string(3) "ddd" -} ---> Pattern: '\\\`\^\.\[\$\(\)\|\*\+\?\{\''; string: '\`^.[$()|*+?{'' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(14) -array(1) { - [0]=> - string(14) "\`^.[$()|*+?{'" -} ---> Pattern: '\a'; string: 'a' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) -array(1) { - [0]=> - string(1) "a" -} ---> Pattern: '[0-9][^0-9]'; string: '2a' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(2) -array(1) { - [0]=> - string(2) "2a" -} ---> Pattern: '^[[:alnum:]]{62,62}$'; string: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(62) -array(1) { - [0]=> - string(62) "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" -} ---> Pattern: '^[[:digit:]]{5}'; string: '0123456789' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(5) -array(1) { - [0]=> - string(5) "01234" -} ---> Pattern: '[[:digit:]]{5}$'; string: '0123456789' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(5) -array(1) { - [0]=> - string(5) "56789" -} ---> Pattern: '[[:blank:]]{1,10}'; string: ' - ' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(2) -array(1) { - [0]=> - string(2) " " -} ---> Pattern: '[[:print:]]{3}'; string: ' a ' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(3) -array(1) { - [0]=> - string(3) " a " -} -Done diff --git a/ext/ereg/tests/ereg_basic_002.phpt b/ext/ereg/tests/ereg_basic_002.phpt deleted file mode 100644 index 75665fb100..0000000000 --- a/ext/ereg/tests/ereg_basic_002.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -Test ereg() function : basic functionality (without $regs) ---FILE-- -<?php -/* Prototype : proto int ereg(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test a number of simple, valid matches with ereg, without specifying $regs - */ - -echo "*** Testing ereg() : basic functionality ***\n"; - -include(dirname(__FILE__) . '/regular_expressions.inc'); - -foreach ($expressions as $re) { - list($pattern,$string) = $re; - echo "--> Pattern: '$pattern'; string: '$string'\n"; - var_dump(ereg($pattern, $string)); -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg() : basic functionality *** ---> Pattern: '..(a|b|c)(a|b|c)..'; string: '--- ab ---' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) ---> Pattern: '()'; string: '' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) ---> Pattern: '()'; string: 'abcdef' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) ---> Pattern: '[x]|[^x]'; string: 'abcdef' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) ---> Pattern: '(a{1})(a{1,}) (b{1,3}) (c+) (d?ddd|e)'; string: '--- aaa bbb ccc ddd ---' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) ---> Pattern: '\\\`\^\.\[\$\(\)\|\*\+\?\{\''; string: '\`^.[$()|*+?{'' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) ---> Pattern: '\a'; string: 'a' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) ---> Pattern: '[0-9][^0-9]'; string: '2a' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) ---> Pattern: '^[[:alnum:]]{62,62}$'; string: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) ---> Pattern: '^[[:digit:]]{5}'; string: '0123456789' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) ---> Pattern: '[[:digit:]]{5}$'; string: '0123456789' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) ---> Pattern: '[[:blank:]]{1,10}'; string: ' - ' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) ---> Pattern: '[[:print:]]{3}'; string: ' a ' - -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) -Done diff --git a/ext/ereg/tests/ereg_basic_003.phpt b/ext/ereg/tests/ereg_basic_003.phpt deleted file mode 100644 index 0cbe0797b9..0000000000 --- a/ext/ereg/tests/ereg_basic_003.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Test ereg() function : basic functionality - long RE ---FILE-- -<?php -/* Prototype : proto int ereg(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test a long RE with lots of matches - */ - -var_dump(ereg(str_repeat('(.)', 2048), str_repeat('x', 2048))); -var_dump(ereg(str_repeat('(.)', 2048), str_repeat('x', 2048), $regs)); -var_dump(count($regs)); - -echo "Done"; -?> ---EXPECTF-- -Deprecated: Function ereg() is deprecated in %s on line %d -int(1) - -Deprecated: Function ereg() is deprecated in %s on line %d -int(2048) -int(2049) -Done diff --git a/ext/ereg/tests/ereg_basic_004.phpt b/ext/ereg/tests/ereg_basic_004.phpt deleted file mode 100644 index 20bdf80073..0000000000 --- a/ext/ereg/tests/ereg_basic_004.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Test ereg() function : basic functionality - a few non-matches ---FILE-- -<?php -/* Prototype : proto int ereg(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -$regs = 'original'; - -var_dump(ereg('A', 'a', $regs)); -var_dump(ereg('[A-Z]', '0', $regs)); -var_dump(ereg('(a){4}', 'aaa', $regs)); -var_dump(ereg('^a', 'ba', $regs)); -var_dump(ereg('b$', 'ba', $regs)); -var_dump(ereg('[:alpha:]', 'x', $regs)); - -// Ensure $regs is unchanged -var_dump($regs); - -echo "Done"; -?> ---EXPECTF-- -Deprecated: Function ereg() is deprecated in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d -bool(false) -string(8) "original" -Done diff --git a/ext/ereg/tests/ereg_error_001.phpt b/ext/ereg/tests/ereg_error_001.phpt deleted file mode 100644 index ccb770897d..0000000000 --- a/ext/ereg/tests/ereg_error_001.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -Test ereg() function : error conditions - wrong number of args ---FILE-- -<?php -/* Prototype : proto int ereg(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test wrong number of args - */ - -echo "*** Testing ereg() : error conditions ***\n"; - - -//Test ereg with one more than the expected number of arguments -echo "\n-- Testing ereg() function with more than expected no. of arguments --\n"; -$pattern = 'string_val'; -$string = 'string_val'; -$registers = array(1, 2); -$extra_arg = 10; -var_dump( ereg($pattern, $string, $registers, $extra_arg) ); - -// Testing ereg with one less than the expected number of arguments -echo "\n-- Testing ereg() function with less than expected no. of arguments --\n"; -$pattern = 'string_val'; -var_dump( ereg($pattern) ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg() : error conditions *** - --- Testing ereg() function with more than expected no. of arguments -- - -Deprecated: Function ereg() is deprecated in %s on line %d - -Warning: ereg() expects at most 3 parameters, 4 given in %s on line %d -NULL - --- Testing ereg() function with less than expected no. of arguments -- - -Deprecated: Function ereg() is deprecated in %s on line %d - -Warning: ereg() expects at least 2 parameters, 1 given in %s on line %d -NULL -Done diff --git a/ext/ereg/tests/ereg_error_002.phpt b/ext/ereg/tests/ereg_error_002.phpt deleted file mode 100644 index 707b7317f7..0000000000 --- a/ext/ereg/tests/ereg_error_002.phpt +++ /dev/null @@ -1,118 +0,0 @@ ---TEST-- -Test ereg() function : error conditions - test bad regular expressions ---FILE-- -<?php -/* Prototype : proto int ereg(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test bad regular expressions - */ - -echo "*** Testing ereg() : error conditions ***\n"; - -$regs = 'original'; - -var_dump(ereg("", "hello")); -var_dump(ereg("c(d", "hello")); -var_dump(ereg("a[b", "hello")); -var_dump(ereg("c(d", "hello")); -var_dump(ereg("*", "hello")); -var_dump(ereg("+", "hello")); -var_dump(ereg("?", "hello")); -var_dump(ereg("(+?*)", "hello", $regs)); -var_dump(ereg("h{256}", "hello")); -var_dump(ereg("h|", "hello")); -var_dump(ereg("h{0}", "hello")); -var_dump(ereg("h{2,1}", "hello")); -var_dump(ereg('[a-c-e]', 'd')); -var_dump(ereg('\\', 'x')); -var_dump(ereg('([9-0])', '1', $regs)); - -//ensure $regs unchanged -var_dump($regs); - -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg() : error conditions *** - -Deprecated: Function ereg() is deprecated in %s on line %d - -Warning: ereg(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d - -Warning: ereg(): REG_EPAREN in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d - -Warning: ereg(): REG_EBRACK in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d - -Warning: ereg(): REG_EPAREN in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d - -Warning: ereg(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d - -Warning: ereg(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d - -Warning: ereg(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d - -Warning: ereg(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d - -Warning: ereg(): REG_BADBR in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d - -Warning: ereg(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d - -Warning: ereg(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d - -Warning: ereg(): REG_BADBR in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d - -Warning: ereg(): REG_ERANGE in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d - -Warning: ereg(): REG_EESCAPE in %s on line %d -bool(false) - -Deprecated: Function ereg() is deprecated in %s on line %d - -Warning: ereg(): REG_ERANGE in %s on line %d -bool(false) -string(8) "original" -Done diff --git a/ext/ereg/tests/ereg_replace_basic_001.phpt b/ext/ereg/tests/ereg_replace_basic_001.phpt deleted file mode 100644 index 66b056ed60..0000000000 --- a/ext/ereg/tests/ereg_replace_basic_001.phpt +++ /dev/null @@ -1,86 +0,0 @@ ---TEST-- -Test ereg_replace() function : basic functionality ---FILE-- -<?php -/* Prototype : proto string ereg_replace(string pattern, string replacement, string string) - * Description: Replace regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test a number of simple, valid matches with ereg_replace - */ - -echo "*** Testing ereg() : basic functionality ***\n"; - -include(dirname(__FILE__) . '/regular_expressions.inc'); - -$replacement = '[this is a replacement]'; - -foreach ($expressions as $re) { - list($pattern, $match) = $re; - echo "--> Pattern: '$pattern'; match: '$match'\n"; - var_dump(ereg_replace($pattern, $replacement, $match . ' this contains some matches ' . $match)); -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg() : basic functionality *** ---> Pattern: '..(a|b|c)(a|b|c)..'; match: '--- ab ---' - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(82) "--[this is a replacement]-- this contains some matches --[this is a replacement]--" ---> Pattern: '()'; match: '' - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(695) "[this is a replacement] [this is a replacement]t[this is a replacement]h[this is a replacement]i[this is a replacement]s[this is a replacement] [this is a replacement]c[this is a replacement]o[this is a replacement]n[this is a replacement]t[this is a replacement]a[this is a replacement]i[this is a replacement]n[this is a replacement]s[this is a replacement] [this is a replacement]s[this is a replacement]o[this is a replacement]m[this is a replacement]e[this is a replacement] [this is a replacement]m[this is a replacement]a[this is a replacement]t[this is a replacement]c[this is a replacement]h[this is a replacement]e[this is a replacement]s[this is a replacement] [this is a replacement]" ---> Pattern: '()'; match: 'abcdef' - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(983) "[this is a replacement]a[this is a replacement]b[this is a replacement]c[this is a replacement]d[this is a replacement]e[this is a replacement]f[this is a replacement] [this is a replacement]t[this is a replacement]h[this is a replacement]i[this is a replacement]s[this is a replacement] [this is a replacement]c[this is a replacement]o[this is a replacement]n[this is a replacement]t[this is a replacement]a[this is a replacement]i[this is a replacement]n[this is a replacement]s[this is a replacement] [this is a replacement]s[this is a replacement]o[this is a replacement]m[this is a replacement]e[this is a replacement] [this is a replacement]m[this is a replacement]a[this is a replacement]t[this is a replacement]c[this is a replacement]h[this is a replacement]e[this is a replacement]s[this is a replacement] [this is a replacement]a[this is a replacement]b[this is a replacement]c[this is a replacement]d[this is a replacement]e[this is a replacement]f[this is a replacement]" ---> Pattern: '[x]|[^x]'; match: 'abcdef' - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(920) "[this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement]" ---> Pattern: '(a{1})(a{1,}) (b{1,3}) (c+) (d?ddd|e)'; match: '--- aaa bbb ccc ddd ---' - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(90) "--- [this is a replacement] --- this contains some matches --- [this is a replacement] ---" ---> Pattern: '\\\`\^\.\[\$\(\)\|\*\+\?\{\''; match: '\`^.[$()|*+?{'' - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(74) "[this is a replacement] this contains some matches [this is a replacement]" ---> Pattern: '\a'; match: 'a' - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(118) "[this is a replacement] this cont[this is a replacement]ins some m[this is a replacement]tches [this is a replacement]" ---> Pattern: '[0-9][^0-9]'; match: '2a' - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(74) "[this is a replacement] this contains some matches [this is a replacement]" ---> Pattern: '^[[:alnum:]]{62,62}$'; match: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(152) "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ this contains some matches 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ---> Pattern: '^[[:digit:]]{5}'; match: '0123456789' - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(66) "[this is a replacement]56789 this contains some matches 0123456789" ---> Pattern: '[[:digit:]]{5}$'; match: '0123456789' - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(66) "0123456789 this contains some matches 01234[this is a replacement]" ---> Pattern: '[[:blank:]]{1,10}'; match: ' - ' - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(163) " -[this is a replacement]this[this is a replacement]contains[this is a replacement]some[this is a replacement]matches[this is a replacement] -[this is a replacement]" ---> Pattern: '[[:print:]]{3}'; match: ' a ' - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(254) "[this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement] " -Done diff --git a/ext/ereg/tests/ereg_replace_basic_002.phpt b/ext/ereg/tests/ereg_replace_basic_002.phpt deleted file mode 100644 index e12612d5ad..0000000000 --- a/ext/ereg/tests/ereg_replace_basic_002.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test ereg_replace() function : basic functionality - a few non-matches ---FILE-- -<?php -/* Prototype : proto string ereg_replace(string pattern, string replacement, string string) - * Description: Replace regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -$replacement = 'r'; - -var_dump(ereg_replace('A', $replacement, 'a')); -var_dump(ereg_replace('[A-Z]', $replacement, '0')); -var_dump(ereg_replace('(a){4}', $replacement, 'aaa')); -var_dump(ereg_replace('^a', $replacement, 'ba')); -var_dump(ereg_replace('b$', $replacement, 'ba')); -var_dump(ereg_replace('[:alpha:]', $replacement, 'x')); - - -echo "Done"; -?> ---EXPECTF-- -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(1) "a" - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(1) "0" - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(3) "aaa" - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(2) "ba" - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(2) "ba" - -Deprecated: Function ereg_replace() is deprecated in %s on line %d -string(1) "x" -Done diff --git a/ext/ereg/tests/ereg_replace_error_001.phpt b/ext/ereg/tests/ereg_replace_error_001.phpt deleted file mode 100644 index d49d87f9d8..0000000000 --- a/ext/ereg/tests/ereg_replace_error_001.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test ereg_replace() function : error conditions - wrong number of args ---FILE-- -<?php -/* Prototype : proto string ereg_replace(string pattern, string replacement, string string) - * Description: Replace regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -echo "*** Testing ereg_replace() : error conditions ***\n"; - - -//Test ereg_replace with one more than the expected number of arguments -echo "\n-- Testing ereg_replace() function with more than expected no. of arguments --\n"; -$pattern = 'string_val'; -$replacement = 'string_val'; -$string = 'string_val'; -$extra_arg = 10; -var_dump( ereg_replace($pattern, $replacement, $string, $extra_arg) ); - -// Testing ereg_replace with one less than the expected number of arguments -echo "\n-- Testing ereg_replace() function with less than expected no. of arguments --\n"; -$pattern = 'string_val'; -$replacement = 'string_val'; -var_dump( ereg_replace($pattern, $replacement) ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg_replace() : error conditions *** - --- Testing ereg_replace() function with more than expected no. of arguments -- - -Deprecated: Function ereg_replace() is deprecated in %s on line %d - -Warning: ereg_replace() expects exactly 3 parameters, 4 given in %s on line %d -NULL - --- Testing ereg_replace() function with less than expected no. of arguments -- - -Deprecated: Function ereg_replace() is deprecated in %s on line %d - -Warning: ereg_replace() expects exactly 3 parameters, 2 given in %s on line %d -NULL -Done diff --git a/ext/ereg/tests/ereg_replace_error_002.phpt b/ext/ereg/tests/ereg_replace_error_002.phpt deleted file mode 100644 index b161a0dcf2..0000000000 --- a/ext/ereg/tests/ereg_replace_error_002.phpt +++ /dev/null @@ -1,106 +0,0 @@ ---TEST-- -Test ereg_replace() function : error conditions - bad regular expressions ---FILE-- -<?php -/* Prototype : proto string ereg_replace(string pattern, string replacement, string string) - * Description: Replace regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -echo "*** Testing ereg_replace() : bad REs ***\n"; -var_dump(ereg_replace("", "hello", "some string")); -var_dump(ereg_replace("c(d", "hello", "some string")); -var_dump(ereg_replace("a[b", "hello", "some string")); -var_dump(ereg_replace("c(d", "hello", "some string"));; -var_dump(ereg_replace("*", "hello", "some string")); -var_dump(ereg_replace("+", "hello", "some string")); -var_dump(ereg_replace("?", "hello", "some string")); -var_dump(ereg_replace("(+?*)", "hello", "some string")); -var_dump(ereg_replace("h{256}", "hello", "some string")); -var_dump(ereg_replace("h|", "hello", "some string")); -var_dump(ereg_replace("h{0}", "hello", "some string")); -var_dump(ereg_replace("h{2,1}", "hello", "some string")); -var_dump(ereg_replace('[a-c-e]', 'd', "some string")); -var_dump(ereg_replace('\\', 'x', "some string")); -var_dump(ereg_replace('([9-0])', '1', "some string")); -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg_replace() : bad REs *** - -Deprecated: Function ereg_replace() is deprecated in %s on line %d - -Warning: ereg_replace(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function ereg_replace() is deprecated in %s on line %d - -Warning: ereg_replace(): REG_EPAREN in %s on line %d -bool(false) - -Deprecated: Function ereg_replace() is deprecated in %s on line %d - -Warning: ereg_replace(): REG_EBRACK in %s on line %d -bool(false) - -Deprecated: Function ereg_replace() is deprecated in %s on line %d - -Warning: ereg_replace(): REG_EPAREN in %s on line %d -bool(false) - -Deprecated: Function ereg_replace() is deprecated in %s on line %d - -Warning: ereg_replace(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function ereg_replace() is deprecated in %s on line %d - -Warning: ereg_replace(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function ereg_replace() is deprecated in %s on line %d - -Warning: ereg_replace(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function ereg_replace() is deprecated in %s on line %d - -Warning: ereg_replace(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function ereg_replace() is deprecated in %s on line %d - -Warning: ereg_replace(): REG_BADBR in %s on line %d -bool(false) - -Deprecated: Function ereg_replace() is deprecated in %s on line %d - -Warning: ereg_replace(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function ereg_replace() is deprecated in %s on line %d - -Warning: ereg_replace(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function ereg_replace() is deprecated in %s on line %d - -Warning: ereg_replace(): REG_BADBR in %s on line %d -bool(false) - -Deprecated: Function ereg_replace() is deprecated in %s on line %d - -Warning: ereg_replace(): REG_ERANGE in %s on line %d -bool(false) - -Deprecated: Function ereg_replace() is deprecated in %s on line %d - -Warning: ereg_replace(): REG_EESCAPE in %s on line %d -bool(false) - -Deprecated: Function ereg_replace() is deprecated in %s on line %d - -Warning: ereg_replace(): REG_ERANGE in %s on line %d -bool(false) -Done diff --git a/ext/ereg/tests/ereg_replace_variation_001.phpt b/ext/ereg/tests/ereg_replace_variation_001.phpt deleted file mode 100644 index 1e16d1c8cb..0000000000 --- a/ext/ereg/tests/ereg_replace_variation_001.phpt +++ /dev/null @@ -1,205 +0,0 @@ ---TEST-- -Test ereg_replace() function : usage variations - unexpected type arg 1 ---FILE-- -<?php -/* Prototype : proto string ereg_replace(string pattern, string replacement, string string) - * Description: Replace regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); - -echo "*** Testing ereg_replace() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$replacement = 'new'; -$string = 'original'; - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for pattern - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( ereg_replace($value, $replacement, $string) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg_replace() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(64) -Error: 8 - Undefined variable: unset_var, %s(67) - -Arg value 0 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace(): REG_EMPTY, %s(74) -bool(false) - -Arg value 1 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "original" - -Arg value 12345 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "original" - -Arg value -2345 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "original" - -Arg value 10.5 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "original" - -Arg value -10.5 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "original" - -Arg value 101234567000 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "original" - -Arg value 1.07654321E-9 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace(): REG_EMPTY, %s(74) -bool(false) - -Arg value 0.5 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace(): REG_EMPTY, %s(74) -bool(false) -Error: 8 - Array to string conversion, %sereg_replace_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace(): REG_EMPTY, %s(74) -bool(false) -Error: 8 - Array to string conversion, %sereg_replace_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "original" -Error: 8 - Array to string conversion, %sereg_replace_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "original" -Error: 8 - Array to string conversion, %sereg_replace_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "original" -Error: 8 - Array to string conversion, %sereg_replace_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "original" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace(): REG_EMPTY, %s(74) -bool(false) - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace(): REG_EMPTY, %s(74) -bool(false) - -Arg value 1 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "original" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace(): REG_EMPTY, %s(74) -bool(false) - -Arg value 1 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "original" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace(): REG_EMPTY, %s(74) -bool(false) - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace(): REG_EMPTY, %s(74) -bool(false) - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace(): REG_EMPTY, %s(74) -bool(false) -Error: 4096 - Object of class stdClass could not be converted to string, %s(73) - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 8 - Object of class stdClass could not be converted to int, %s(74) -string(8) "original" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace(): REG_EMPTY, %s(74) -bool(false) - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace(): REG_EMPTY, %s(74) -bool(false) -Done diff --git a/ext/ereg/tests/ereg_replace_variation_002.phpt b/ext/ereg/tests/ereg_replace_variation_002.phpt deleted file mode 100644 index afaece6b22..0000000000 --- a/ext/ereg/tests/ereg_replace_variation_002.phpt +++ /dev/null @@ -1,193 +0,0 @@ ---TEST-- -Test ereg_replace() function : usage variations - unexpected type arg 2 ---FILE-- -<?php -/* Prototype : proto string ereg_replace(string pattern, string replacement, string string) - * Description: Replace regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); - -echo "*** Testing ereg_replace() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$pattern = b'ell'; -$string = 'hello!'; - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for replacement - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump(urlencode(ereg_replace($pattern, $value, $string))); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg_replace() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(64) -Error: 8 - Undefined variable: unset_var, %s(67) - -Arg value 0 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(5) "ho%21" - -Arg value 1 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "h%01o%21" - -Arg value 12345 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(6) "h9o%21" - -Arg value -2345 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "h%D7o%21" - -Arg value 10.5 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "h%0Ao%21" - -Arg value -10.5 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "h%F6o%21" - -Arg value 101234567000 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(%d) "h%so%21" - -Arg value 1.07654321E-9 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(5) "ho%21" - -Arg value 0.5 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(5) "ho%21" -Error: 8 - Array to string conversion, %sereg_replace_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(5) "ho%21" -Error: 8 - Array to string conversion, %sereg_replace_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "h%01o%21" -Error: 8 - Array to string conversion, %sereg_replace_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "h%01o%21" -Error: 8 - Array to string conversion, %sereg_replace_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "h%01o%21" -Error: 8 - Array to string conversion, %sereg_replace_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "h%01o%21" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(5) "ho%21" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(5) "ho%21" - -Arg value 1 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "h%01o%21" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(5) "ho%21" - -Arg value 1 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(8) "h%01o%21" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(5) "ho%21" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(5) "ho%21" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(5) "ho%21" -Error: 4096 - Object of class stdClass could not be converted to string, %s(73) - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 8 - Object of class stdClass could not be converted to int, %s(74) -string(8) "h%01o%21" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(5) "ho%21" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(5) "ho%21" -Done
\ No newline at end of file diff --git a/ext/ereg/tests/ereg_replace_variation_003.phpt b/ext/ereg/tests/ereg_replace_variation_003.phpt deleted file mode 100644 index b189c4efc6..0000000000 --- a/ext/ereg/tests/ereg_replace_variation_003.phpt +++ /dev/null @@ -1,198 +0,0 @@ ---TEST-- -Test ereg_replace() function : usage variations - unexpected type arg 3 ---FILE-- -<?php -/* Prototype : proto string ereg_replace(string pattern, string replacement, string string) - * Description: Replace regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); - -echo "*** Testing ereg_replace() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$pattern = '1'; -$replacement = 'new value'; - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for string - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( ereg_replace($pattern, $replacement, $value) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg_replace() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(64) -Error: 8 - Undefined variable: unset_var, %s(67) - -Arg value 0 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(1) "0" - -Arg value 1 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(9) "new value" - -Arg value 12345 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(13) "new value2345" - -Arg value -2345 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(5) "-2345" - -Arg value 10.5 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(12) "new value0.5" - -Arg value -10.5 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(13) "-new value0.5" - -Arg value 101234567000 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(28) "new value0new value234567000" - -Arg value 1.07654321E-9 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(29) "new value.0765432new valueE-9" - -Arg value 0.5 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(3) "0.5" -Error: 8 - Array to string conversion, %sereg_replace_variation_003.php(%d) - -Arg value Array -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace() expects parameter 3 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %sereg_replace_variation_003.php(%d) - -Arg value Array -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace() expects parameter 3 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %sereg_replace_variation_003.php(%d) - -Arg value Array -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace() expects parameter 3 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %sereg_replace_variation_003.php(%d) - -Arg value Array -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace() expects parameter 3 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %sereg_replace_variation_003.php(%d) - -Arg value Array -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace() expects parameter 3 to be string, array given, %s(74) -NULL - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(0) "" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(0) "" - -Arg value 1 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(9) "new value" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(0) "" - -Arg value 1 -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(9) "new value" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(0) "" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(0) "" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(0) "" -Error: 4096 - Object of class stdClass could not be converted to string, %s(73) - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -Error: 2 - ereg_replace() expects parameter 3 to be string, object given, %s(74) -NULL - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(0) "" - -Arg value -Error: 8192 - Function ereg_replace() is deprecated, %s(74) -string(0) "" -Done diff --git a/ext/ereg/tests/ereg_variation_001.phpt b/ext/ereg/tests/ereg_variation_001.phpt deleted file mode 100644 index 8e28d89a90..0000000000 --- a/ext/ereg/tests/ereg_variation_001.phpt +++ /dev/null @@ -1,208 +0,0 @@ ---TEST-- -Test ereg() function : usage variations - unexpected type arg 1 ---FILE-- -<?php -/* Prototype : proto int ereg(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); - - -echo "*** Testing ereg() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$string = '1'; -$registers = array(1, 2); - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for pattern - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( ereg($value, $string, $registers) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(65) -Error: 8 - Undefined variable: unset_var, %s(68) - -Arg value 0 -Error: 8192 - Function ereg() is deprecated, %s(75) -bool(false) - -Arg value 1 -Error: 8192 - Function ereg() is deprecated, %s(75) -int(1) - -Arg value 12345 -Error: 8192 - Function ereg() is deprecated, %s(75) -bool(false) - -Arg value -2345 -Error: 8192 - Function ereg() is deprecated, %s(75) -bool(false) - -Arg value 10.5 -Error: 8192 - Function ereg() is deprecated, %s(75) -bool(false) - -Arg value -10.5 -Error: 8192 - Function ereg() is deprecated, %s(75) -bool(false) - -Arg value 101234567000 -Error: 8192 - Function ereg() is deprecated, %s(75) -bool(false) - -Arg value 1.07654321E-9 -Error: 8192 - Function ereg() is deprecated, %s(75) -bool(false) - -Arg value 0.5 -Error: 8192 - Function ereg() is deprecated, %s(75) -bool(false) -Error: 8 - Array to string conversion, %sereg_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function ereg() is deprecated, %s(75) -Error: 8 - Array to string conversion, %s(75) -bool(false) -Error: 8 - Array to string conversion, %sereg_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function ereg() is deprecated, %s(75) -Error: 8 - Array to string conversion, %s(75) -bool(false) -Error: 8 - Array to string conversion, %sereg_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function ereg() is deprecated, %s(75) -Error: 8 - Array to string conversion, %s(75) -bool(false) -Error: 8 - Array to string conversion, %sereg_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function ereg() is deprecated, %s(75) -Error: 8 - Array to string conversion, %s(75) -bool(false) -Error: 8 - Array to string conversion, %sereg_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function ereg() is deprecated, %s(75) -Error: 8 - Array to string conversion, %s(75) -bool(false) - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(75) -Error: 2 - ereg(): REG_EMPTY, %s(75) -bool(false) - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(75) -Error: 2 - ereg(): REG_EMPTY, %s(75) -bool(false) - -Arg value 1 -Error: 8192 - Function ereg() is deprecated, %s(75) -int(1) - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(75) -Error: 2 - ereg(): REG_EMPTY, %s(75) -bool(false) - -Arg value 1 -Error: 8192 - Function ereg() is deprecated, %s(75) -int(1) - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(75) -Error: 2 - ereg(): REG_EMPTY, %s(75) -bool(false) - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(75) -Error: 2 - ereg(): REG_EMPTY, %s(75) -bool(false) - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(75) -Error: 2 - ereg(): REG_EMPTY, %s(75) -bool(false) -Error: 4096 - Object of class stdClass could not be converted to string, %s(74) - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(75) -Error: 4096 - Object of class stdClass could not be converted to string, %s(75) -Error: 8 - Object of class stdClass to string conversion, %s(75) -bool(false) - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(75) -Error: 2 - ereg(): REG_EMPTY, %s(75) -bool(false) - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(75) -Error: 2 - ereg(): REG_EMPTY, %s(75) -bool(false) -Done diff --git a/ext/ereg/tests/ereg_variation_002.phpt b/ext/ereg/tests/ereg_variation_002.phpt deleted file mode 100644 index 33e0fe1d10..0000000000 --- a/ext/ereg/tests/ereg_variation_002.phpt +++ /dev/null @@ -1,198 +0,0 @@ ---TEST-- -Test ereg() function : usage variations - unexpected type arg 2 ---FILE-- -<?php -/* Prototype : proto int ereg(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); - -echo "*** Testing ereg() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$pattern = '1'; -$registers = array(); - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for string - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( ereg($pattern, $value, $registers) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(64) -Error: 8 - Undefined variable: unset_var, %s(67) - -Arg value 0 -Error: 8192 - Function ereg() is deprecated, %s(74) -bool(false) - -Arg value 1 -Error: 8192 - Function ereg() is deprecated, %s(74) -int(1) - -Arg value 12345 -Error: 8192 - Function ereg() is deprecated, %s(74) -int(1) - -Arg value -2345 -Error: 8192 - Function ereg() is deprecated, %s(74) -bool(false) - -Arg value 10.5 -Error: 8192 - Function ereg() is deprecated, %s(74) -int(1) - -Arg value -10.5 -Error: 8192 - Function ereg() is deprecated, %s(74) -int(1) - -Arg value 101234567000 -Error: 8192 - Function ereg() is deprecated, %s(74) -int(1) - -Arg value 1.07654321E-9 -Error: 8192 - Function ereg() is deprecated, %s(74) -int(1) - -Arg value 0.5 -Error: 8192 - Function ereg() is deprecated, %s(74) -bool(false) -Error: 8 - Array to string conversion, %sereg_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function ereg() is deprecated, %s(74) -Error: 2 - ereg() expects parameter 2 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %sereg_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function ereg() is deprecated, %s(74) -Error: 2 - ereg() expects parameter 2 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %sereg_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function ereg() is deprecated, %s(74) -Error: 2 - ereg() expects parameter 2 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %sereg_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function ereg() is deprecated, %s(74) -Error: 2 - ereg() expects parameter 2 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %sereg_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function ereg() is deprecated, %s(74) -Error: 2 - ereg() expects parameter 2 to be string, array given, %s(74) -NULL - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(74) -bool(false) - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(74) -bool(false) - -Arg value 1 -Error: 8192 - Function ereg() is deprecated, %s(74) -int(1) - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(74) -bool(false) - -Arg value 1 -Error: 8192 - Function ereg() is deprecated, %s(74) -int(1) - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(74) -bool(false) - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(74) -bool(false) - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(74) -bool(false) -Error: 4096 - Object of class stdClass could not be converted to string, %s(73) - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(74) -Error: 2 - ereg() expects parameter 2 to be string, object given, %s(74) -NULL - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(74) -bool(false) - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(74) -bool(false) -Done diff --git a/ext/ereg/tests/ereg_variation_003.phpt b/ext/ereg/tests/ereg_variation_003.phpt deleted file mode 100644 index bf898d908f..0000000000 --- a/ext/ereg/tests/ereg_variation_003.phpt +++ /dev/null @@ -1,305 +0,0 @@ ---TEST-- -Test ereg() function : usage variations - unexpected type for arg 3 ---FILE-- -<?php -/* Prototype : proto int ereg(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); - -echo "*** Testing ereg() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$pattern = 'h(.*)lo!'; -$string = 'hello!'; - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // 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 registers - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( ereg($pattern, $string, $value) ); - var_dump($value); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(61) -Error: 8 - Undefined variable: unset_var, %s(64) - -Arg value 0 -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value 1 -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value 12345 -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -2345 -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value 10.5 -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -10.5 -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value 101234567000 -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value 1.07654321E-9 -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value 0.5 -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value 1 -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value 1 -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value string -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value string -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} -Error: 4096 - Object of class stdClass could not be converted to string, %s(70) - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -Error: 8192 - Function ereg() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} -Done diff --git a/ext/ereg/tests/ereg_variation_004.phpt b/ext/ereg/tests/ereg_variation_004.phpt deleted file mode 100644 index 86f616f86f..0000000000 --- a/ext/ereg/tests/ereg_variation_004.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Test ereg() function : usage variations - pass non-variable as arg 3, which is pass-by-ref. ---FILE-- -<?php -/* Prototype : proto int ereg(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -var_dump(ereg('l{2}', 'hello', str_repeat('x',1))); -echo "Done"; -?> ---EXPECTF-- -Strict Standards: Only variables should be passed by reference in %s on line %d - -Deprecated: Function ereg() is deprecated in %s on line %d -int(2) -Done diff --git a/ext/ereg/tests/eregi_basic.phpt b/ext/ereg/tests/eregi_basic.phpt deleted file mode 100644 index cbcfdb6554..0000000000 --- a/ext/ereg/tests/eregi_basic.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test eregi() function : basic functionality - confirm case insensitivity ---FILE-- -<?php -/* Prototype : proto int eregi(string pattern, string string [, array registers]) - * Description: Case-insensitive regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test basic functionality of eregi() - */ - -echo "*** Testing eregi() : basic functionality ***\n"; -$string = <<<END -UPPERCASE WORDS -lowercase words -MIxED CaSe woRdS -END; - -var_dump(eregi('words', $string, $match1)); -var_dump($match1); - -var_dump(eregi('[[:lower:]]+[[:space:]]case', $string, $match2)); //character class lower should just match [a-z] but in case insensitive search matches [a-zA-Z] -var_dump($match2); -echo "Done"; -?> ---EXPECTF-- -*** Testing eregi() : basic functionality *** - -Deprecated: Function eregi() is deprecated in %s on line %d -int(5) -array(1) { - [0]=> - string(5) "WORDS" -} - -Deprecated: Function eregi() is deprecated in %s on line %d -int(10) -array(1) { - [0]=> - string(10) "MIxED CaSe" -} -Done diff --git a/ext/ereg/tests/eregi_basic_001.phpt b/ext/ereg/tests/eregi_basic_001.phpt deleted file mode 100644 index 9460b89e11..0000000000 --- a/ext/ereg/tests/eregi_basic_001.phpt +++ /dev/null @@ -1,153 +0,0 @@ ---TEST-- -Test eregi() function : basic functionality (with $regs) ---FILE-- -<?php -/* Prototype : proto int eregi(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test a number of simple, valid matches with eregi, specifying $regs - */ - -echo "*** Testing eregi() : basic functionality ***\n"; - -include(dirname(__FILE__) . '/regular_expressions.inc'); - -foreach ($expressions as $re) { - list($pattern,$string) = $re; - echo "--> Pattern: '$pattern'; string: '$string'\n"; - var_dump(eregi($pattern, $string, $regs)); - var_dump($regs); -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing eregi() : basic functionality *** ---> Pattern: '..(a|b|c)(a|b|c)..'; string: '--- ab ---' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(6) -array(3) { - [0]=> - string(6) "- ab -" - [1]=> - string(1) "a" - [2]=> - string(1) "b" -} ---> Pattern: '()'; string: '' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) -array(2) { - [0]=> - bool(false) - [1]=> - bool(false) -} ---> Pattern: '()'; string: 'abcdef' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) -array(2) { - [0]=> - bool(false) - [1]=> - bool(false) -} ---> Pattern: '[x]|[^x]'; string: 'abcdef' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) -array(1) { - [0]=> - string(1) "a" -} ---> Pattern: '(a{1})(a{1,}) (b{1,3}) (c+) (d?ddd|e)'; string: '--- aaa bbb ccc ddd ---' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(15) -array(6) { - [0]=> - string(15) "aaa bbb ccc ddd" - [1]=> - string(1) "a" - [2]=> - string(2) "aa" - [3]=> - string(3) "bbb" - [4]=> - string(3) "ccc" - [5]=> - string(3) "ddd" -} ---> Pattern: '\\\`\^\.\[\$\(\)\|\*\+\?\{\''; string: '\`^.[$()|*+?{'' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(14) -array(1) { - [0]=> - string(14) "\`^.[$()|*+?{'" -} ---> Pattern: '\a'; string: 'a' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) -array(1) { - [0]=> - string(1) "a" -} ---> Pattern: '[0-9][^0-9]'; string: '2a' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(2) -array(1) { - [0]=> - string(2) "2a" -} ---> Pattern: '^[[:alnum:]]{62,62}$'; string: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(62) -array(1) { - [0]=> - string(62) "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" -} ---> Pattern: '^[[:digit:]]{5}'; string: '0123456789' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(5) -array(1) { - [0]=> - string(5) "01234" -} ---> Pattern: '[[:digit:]]{5}$'; string: '0123456789' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(5) -array(1) { - [0]=> - string(5) "56789" -} ---> Pattern: '[[:blank:]]{1,10}'; string: ' - ' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(2) -array(1) { - [0]=> - string(2) " " -} ---> Pattern: '[[:print:]]{3}'; string: ' a ' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(3) -array(1) { - [0]=> - string(3) " a " -} -Done diff --git a/ext/ereg/tests/eregi_basic_002.phpt b/ext/ereg/tests/eregi_basic_002.phpt deleted file mode 100644 index f81821ab1b..0000000000 --- a/ext/ereg/tests/eregi_basic_002.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -Test eregi() function : basic functionality (without $regs) ---FILE-- -<?php -/* Prototype : proto int eregi(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test a number of simple, valid matches with eregi, without specifying $regs - */ - -echo "*** Testing eregi() : basic functionality ***\n"; - -include(dirname(__FILE__) . '/regular_expressions.inc'); - -foreach ($expressions as $re) { - list($pattern,$string) = $re; - echo "--> Pattern: '$pattern'; string: '$string'\n"; - var_dump(eregi($pattern, $string)); -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing eregi() : basic functionality *** ---> Pattern: '..(a|b|c)(a|b|c)..'; string: '--- ab ---' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) ---> Pattern: '()'; string: '' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) ---> Pattern: '()'; string: 'abcdef' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) ---> Pattern: '[x]|[^x]'; string: 'abcdef' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) ---> Pattern: '(a{1})(a{1,}) (b{1,3}) (c+) (d?ddd|e)'; string: '--- aaa bbb ccc ddd ---' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) ---> Pattern: '\\\`\^\.\[\$\(\)\|\*\+\?\{\''; string: '\`^.[$()|*+?{'' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) ---> Pattern: '\a'; string: 'a' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) ---> Pattern: '[0-9][^0-9]'; string: '2a' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) ---> Pattern: '^[[:alnum:]]{62,62}$'; string: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) ---> Pattern: '^[[:digit:]]{5}'; string: '0123456789' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) ---> Pattern: '[[:digit:]]{5}$'; string: '0123456789' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) ---> Pattern: '[[:blank:]]{1,10}'; string: ' - ' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) ---> Pattern: '[[:print:]]{3}'; string: ' a ' - -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) -Done diff --git a/ext/ereg/tests/eregi_basic_003.phpt b/ext/ereg/tests/eregi_basic_003.phpt deleted file mode 100644 index f045ad4280..0000000000 --- a/ext/ereg/tests/eregi_basic_003.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Test eregi() function : basic functionality - long RE ---FILE-- -<?php -/* Prototype : proto int eregi(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test a long RE with lots of matches - */ - -var_dump(eregi(str_repeat('(.)', 2048), str_repeat('x', 2048))); -var_dump(eregi(str_repeat('(.)', 2048), str_repeat('x', 2048), $regs)); -var_dump(count($regs)); - -echo "Done"; -?> ---EXPECTF-- -Deprecated: Function eregi() is deprecated in %s on line %d -int(1) - -Deprecated: Function eregi() is deprecated in %s on line %d -int(2048) -int(2049) -Done diff --git a/ext/ereg/tests/eregi_basic_004.phpt b/ext/ereg/tests/eregi_basic_004.phpt deleted file mode 100644 index 78d8f5e547..0000000000 --- a/ext/ereg/tests/eregi_basic_004.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Test eregi() function : basic functionality - a few non-matches ---FILE-- -<?php -/* Prototype : proto int eregi(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -$regs = 'original'; - -var_dump(eregi('[A-Z]', '0', $regs)); -var_dump(eregi('(a){4}', 'aaa', $regs)); -var_dump(eregi('^a', 'ba', $regs)); -var_dump(eregi('b$', 'ba', $regs)); -var_dump(eregi('[:alpha:]', 'x', $regs)); - -// Ensure $regs is unchanged -var_dump($regs); - -echo "Done"; -?> ---EXPECTF-- -Deprecated: Function eregi() is deprecated in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d -bool(false) -string(8) "original" -Done diff --git a/ext/ereg/tests/eregi_error_001.phpt b/ext/ereg/tests/eregi_error_001.phpt deleted file mode 100644 index fed3a725c2..0000000000 --- a/ext/ereg/tests/eregi_error_001.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -Test eregi() function : error conditions - wrong number of args ---FILE-- -<?php -/* Prototype : proto int eregi(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test wrong number of args - */ - -echo "*** Testing eregi() : error conditions ***\n"; - - -//Test eregi with one more than the expected number of arguments -echo "\n-- Testing eregi() function with more than expected no. of arguments --\n"; -$pattern = 'string_val'; -$string = 'string_val'; -$registers = array(1, 2); -$extra_arg = 10; -var_dump( eregi($pattern, $string, $registers, $extra_arg) ); - -// Testing eregi with one less than the expected number of arguments -echo "\n-- Testing eregi() function with less than expected no. of arguments --\n"; -$pattern = 'string_val'; -var_dump( eregi($pattern) ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing eregi() : error conditions *** - --- Testing eregi() function with more than expected no. of arguments -- - -Deprecated: Function eregi() is deprecated in %s on line %d - -Warning: eregi() expects at most 3 parameters, 4 given in %s on line %d -NULL - --- Testing eregi() function with less than expected no. of arguments -- - -Deprecated: Function eregi() is deprecated in %s on line %d - -Warning: eregi() expects at least 2 parameters, 1 given in %s on line %d -NULL -Done diff --git a/ext/ereg/tests/eregi_error_002.phpt b/ext/ereg/tests/eregi_error_002.phpt deleted file mode 100644 index 2764741d5d..0000000000 --- a/ext/ereg/tests/eregi_error_002.phpt +++ /dev/null @@ -1,118 +0,0 @@ ---TEST-- -Test eregi() function : error conditions - test bad regular expressions ---FILE-- -<?php -/* Prototype : proto int eregi(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test bad regular expressions - */ - -echo "*** Testing eregi() : error conditions ***\n"; - -$regs = 'original'; - -var_dump(eregi("", "hello")); -var_dump(eregi("c(d", "hello")); -var_dump(eregi("a[b", "hello")); -var_dump(eregi("c(d", "hello")); -var_dump(eregi("*", "hello")); -var_dump(eregi("+", "hello")); -var_dump(eregi("?", "hello")); -var_dump(eregi("(+?*)", "hello", $regs)); -var_dump(eregi("h{256}", "hello")); -var_dump(eregi("h|", "hello")); -var_dump(eregi("h{0}", "hello")); -var_dump(eregi("h{2,1}", "hello")); -var_dump(eregi('[a-c-e]', 'd')); -var_dump(eregi('\\', 'x')); -var_dump(eregi('([9-0])', '1', $regs)); - -//ensure $regs unchanged -var_dump($regs); - -echo "Done"; -?> ---EXPECTF-- -*** Testing eregi() : error conditions *** - -Deprecated: Function eregi() is deprecated in %s on line %d - -Warning: eregi(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d - -Warning: eregi(): REG_EPAREN in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d - -Warning: eregi(): REG_EBRACK in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d - -Warning: eregi(): REG_EPAREN in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d - -Warning: eregi(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d - -Warning: eregi(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d - -Warning: eregi(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d - -Warning: eregi(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d - -Warning: eregi(): REG_BADBR in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d - -Warning: eregi(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d - -Warning: eregi(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d - -Warning: eregi(): REG_BADBR in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d - -Warning: eregi(): REG_ERANGE in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d - -Warning: eregi(): REG_EESCAPE in %s on line %d -bool(false) - -Deprecated: Function eregi() is deprecated in %s on line %d - -Warning: eregi(): REG_ERANGE in %s on line %d -bool(false) -string(8) "original" -Done diff --git a/ext/ereg/tests/eregi_replace_basic.phpt b/ext/ereg/tests/eregi_replace_basic.phpt deleted file mode 100644 index f965c8f03a..0000000000 --- a/ext/ereg/tests/eregi_replace_basic.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Test eregi_replace() function : basic functionality - confirm case insensitivity ---FILE-- - -<?php -/* Prototype : proto string eregi_replace(string pattern, string replacement, string string) - * Description: Case insensitive replace regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test basic functionality of eregi_replace() - */ - -echo "*** Testing eregi_replace() : basic functionality ***\n"; - -$string = 'UPPERCASE WORDS, lowercase words, MIxED CaSe woRdS'; - -echo "String Before...\n"; -var_dump($string); -echo "\nString after...\n"; - -var_dump(eregi_replace('([[:lower:]]+) word', '\\1_character', $string)); - -echo "Done"; -?> - ---EXPECTF-- -*** Testing eregi_replace() : basic functionality *** -String Before... -string(50) "UPPERCASE WORDS, lowercase words, MIxED CaSe woRdS" - -String after... - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(65) "UPPERCASE_characterS, lowercase_characters, MIxED CaSe_characterS" -Done diff --git a/ext/ereg/tests/eregi_replace_basic_001.phpt b/ext/ereg/tests/eregi_replace_basic_001.phpt deleted file mode 100644 index 710e39e2de..0000000000 --- a/ext/ereg/tests/eregi_replace_basic_001.phpt +++ /dev/null @@ -1,86 +0,0 @@ ---TEST-- -Test ereg() function : basic functionality ---FILE-- -<?php -/* Prototype : proto string eregi_replace(string pattern, string replacement, string string) - * Description: Replace regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test a number of simple, valid matches with eregi_replace - */ - -echo "*** Testing ereg() : basic functionality ***\n"; - -include(dirname(__FILE__) . '/regular_expressions.inc'); - -$replacement = '[this is a replacement]'; - -foreach ($expressions as $re) { - list($pattern, $match) = $re; - echo "--> Pattern: '$pattern'; match: '$match'\n"; - var_dump(eregi_replace($pattern, $replacement, $match . ' this contains some matches ' . $match)); -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg() : basic functionality *** ---> Pattern: '..(a|b|c)(a|b|c)..'; match: '--- ab ---' - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(82) "--[this is a replacement]-- this contains some matches --[this is a replacement]--" ---> Pattern: '()'; match: '' - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(695) "[this is a replacement] [this is a replacement]t[this is a replacement]h[this is a replacement]i[this is a replacement]s[this is a replacement] [this is a replacement]c[this is a replacement]o[this is a replacement]n[this is a replacement]t[this is a replacement]a[this is a replacement]i[this is a replacement]n[this is a replacement]s[this is a replacement] [this is a replacement]s[this is a replacement]o[this is a replacement]m[this is a replacement]e[this is a replacement] [this is a replacement]m[this is a replacement]a[this is a replacement]t[this is a replacement]c[this is a replacement]h[this is a replacement]e[this is a replacement]s[this is a replacement] [this is a replacement]" ---> Pattern: '()'; match: 'abcdef' - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(983) "[this is a replacement]a[this is a replacement]b[this is a replacement]c[this is a replacement]d[this is a replacement]e[this is a replacement]f[this is a replacement] [this is a replacement]t[this is a replacement]h[this is a replacement]i[this is a replacement]s[this is a replacement] [this is a replacement]c[this is a replacement]o[this is a replacement]n[this is a replacement]t[this is a replacement]a[this is a replacement]i[this is a replacement]n[this is a replacement]s[this is a replacement] [this is a replacement]s[this is a replacement]o[this is a replacement]m[this is a replacement]e[this is a replacement] [this is a replacement]m[this is a replacement]a[this is a replacement]t[this is a replacement]c[this is a replacement]h[this is a replacement]e[this is a replacement]s[this is a replacement] [this is a replacement]a[this is a replacement]b[this is a replacement]c[this is a replacement]d[this is a replacement]e[this is a replacement]f[this is a replacement]" ---> Pattern: '[x]|[^x]'; match: 'abcdef' - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(920) "[this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement]" ---> Pattern: '(a{1})(a{1,}) (b{1,3}) (c+) (d?ddd|e)'; match: '--- aaa bbb ccc ddd ---' - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(90) "--- [this is a replacement] --- this contains some matches --- [this is a replacement] ---" ---> Pattern: '\\\`\^\.\[\$\(\)\|\*\+\?\{\''; match: '\`^.[$()|*+?{'' - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(74) "[this is a replacement] this contains some matches [this is a replacement]" ---> Pattern: '\a'; match: 'a' - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(118) "[this is a replacement] this cont[this is a replacement]ins some m[this is a replacement]tches [this is a replacement]" ---> Pattern: '[0-9][^0-9]'; match: '2a' - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(74) "[this is a replacement] this contains some matches [this is a replacement]" ---> Pattern: '^[[:alnum:]]{62,62}$'; match: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(152) "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ this contains some matches 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ---> Pattern: '^[[:digit:]]{5}'; match: '0123456789' - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(66) "[this is a replacement]56789 this contains some matches 0123456789" ---> Pattern: '[[:digit:]]{5}$'; match: '0123456789' - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(66) "0123456789 this contains some matches 01234[this is a replacement]" ---> Pattern: '[[:blank:]]{1,10}'; match: ' - ' - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(163) " -[this is a replacement]this[this is a replacement]contains[this is a replacement]some[this is a replacement]matches[this is a replacement] -[this is a replacement]" ---> Pattern: '[[:print:]]{3}'; match: ' a ' - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(254) "[this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement][this is a replacement] " -Done diff --git a/ext/ereg/tests/eregi_replace_basic_002.phpt b/ext/ereg/tests/eregi_replace_basic_002.phpt deleted file mode 100644 index 7683e3323e..0000000000 --- a/ext/ereg/tests/eregi_replace_basic_002.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Test eregi_replace() function : basic functionality - a few non-matches ---FILE-- -<?php -/* Prototype : proto string eregi_replace(string pattern, string replacement, string string) - * Description: Replace regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -$replacement = 'r'; - -var_dump(eregi_replace('[A-Z]', $replacement, '0')); -var_dump(eregi_replace('(a){4}', $replacement, 'aaa')); -var_dump(eregi_replace('^a', $replacement, 'ba')); -var_dump(eregi_replace('b$', $replacement, 'ba')); -var_dump(eregi_replace('[:alpha:]', $replacement, 'x')); - - -echo "Done"; -?> ---EXPECTF-- -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(1) "0" - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(3) "aaa" - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(2) "ba" - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(2) "ba" - -Deprecated: Function eregi_replace() is deprecated in %s on line %d -string(1) "x" -Done diff --git a/ext/ereg/tests/eregi_replace_error_001.phpt b/ext/ereg/tests/eregi_replace_error_001.phpt deleted file mode 100644 index ff94833555..0000000000 --- a/ext/ereg/tests/eregi_replace_error_001.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test eregi_replace() function : error conditions - wrong number of args ---FILE-- -<?php -/* Prototype : proto string eregi_replace(string pattern, string replacement, string string) - * Description: Replace regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -echo "*** Testing eregi_replace() : error conditions ***\n"; - - -//Test eregi_replace with one more than the expected number of arguments -echo "\n-- Testing eregi_replace() function with more than expected no. of arguments --\n"; -$pattern = 'string_val'; -$replacement = 'string_val'; -$string = 'string_val'; -$extra_arg = 10; -var_dump( eregi_replace($pattern, $replacement, $string, $extra_arg) ); - -// Testing eregi_replace with one less than the expected number of arguments -echo "\n-- Testing eregi_replace() function with less than expected no. of arguments --\n"; -$pattern = 'string_val'; -$replacement = 'string_val'; -var_dump( eregi_replace($pattern, $replacement) ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing eregi_replace() : error conditions *** - --- Testing eregi_replace() function with more than expected no. of arguments -- - -Deprecated: Function eregi_replace() is deprecated in %s on line %d - -Warning: eregi_replace() expects exactly 3 parameters, 4 given in %s on line %d -NULL - --- Testing eregi_replace() function with less than expected no. of arguments -- - -Deprecated: Function eregi_replace() is deprecated in %s on line %d - -Warning: eregi_replace() expects exactly 3 parameters, 2 given in %s on line %d -NULL -Done diff --git a/ext/ereg/tests/eregi_replace_error_002.phpt b/ext/ereg/tests/eregi_replace_error_002.phpt deleted file mode 100644 index 32c58613d2..0000000000 --- a/ext/ereg/tests/eregi_replace_error_002.phpt +++ /dev/null @@ -1,106 +0,0 @@ ---TEST-- -Test eregi_replace() function : error conditions - bad regular expressions ---FILE-- -<?php -/* Prototype : proto string eregi_replace(string pattern, string replacement, string string) - * Description: Replace regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -echo "*** Testing eregi_replace() : bad REs ***\n"; -var_dump(eregi_replace("", "hello", "some string")); -var_dump(eregi_replace("c(d", "hello", "some string")); -var_dump(eregi_replace("a[b", "hello", "some string")); -var_dump(eregi_replace("c(d", "hello", "some string"));; -var_dump(eregi_replace("*", "hello", "some string")); -var_dump(eregi_replace("+", "hello", "some string")); -var_dump(eregi_replace("?", "hello", "some string")); -var_dump(eregi_replace("(+?*)", "hello", "some string")); -var_dump(eregi_replace("h{256}", "hello", "some string")); -var_dump(eregi_replace("h|", "hello", "some string")); -var_dump(eregi_replace("h{0}", "hello", "some string")); -var_dump(eregi_replace("h{2,1}", "hello", "some string")); -var_dump(eregi_replace('[a-c-e]', 'd', "some string")); -var_dump(eregi_replace('\\', 'x', "some string")); -var_dump(eregi_replace('([9-0])', '1', "some string")); -echo "Done"; -?> ---EXPECTF-- -*** Testing eregi_replace() : bad REs *** - -Deprecated: Function eregi_replace() is deprecated in %s on line %d - -Warning: eregi_replace(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function eregi_replace() is deprecated in %s on line %d - -Warning: eregi_replace(): REG_EPAREN in %s on line %d -bool(false) - -Deprecated: Function eregi_replace() is deprecated in %s on line %d - -Warning: eregi_replace(): REG_EBRACK in %s on line %d -bool(false) - -Deprecated: Function eregi_replace() is deprecated in %s on line %d - -Warning: eregi_replace(): REG_EPAREN in %s on line %d -bool(false) - -Deprecated: Function eregi_replace() is deprecated in %s on line %d - -Warning: eregi_replace(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function eregi_replace() is deprecated in %s on line %d - -Warning: eregi_replace(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function eregi_replace() is deprecated in %s on line %d - -Warning: eregi_replace(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function eregi_replace() is deprecated in %s on line %d - -Warning: eregi_replace(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function eregi_replace() is deprecated in %s on line %d - -Warning: eregi_replace(): REG_BADBR in %s on line %d -bool(false) - -Deprecated: Function eregi_replace() is deprecated in %s on line %d - -Warning: eregi_replace(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function eregi_replace() is deprecated in %s on line %d - -Warning: eregi_replace(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function eregi_replace() is deprecated in %s on line %d - -Warning: eregi_replace(): REG_BADBR in %s on line %d -bool(false) - -Deprecated: Function eregi_replace() is deprecated in %s on line %d - -Warning: eregi_replace(): REG_ERANGE in %s on line %d -bool(false) - -Deprecated: Function eregi_replace() is deprecated in %s on line %d - -Warning: eregi_replace(): REG_EESCAPE in %s on line %d -bool(false) - -Deprecated: Function eregi_replace() is deprecated in %s on line %d - -Warning: eregi_replace(): REG_ERANGE in %s on line %d -bool(false) -Done diff --git a/ext/ereg/tests/eregi_replace_variation_001.phpt b/ext/ereg/tests/eregi_replace_variation_001.phpt deleted file mode 100644 index e3d2b655f5..0000000000 --- a/ext/ereg/tests/eregi_replace_variation_001.phpt +++ /dev/null @@ -1,205 +0,0 @@ ---TEST-- -Test eregi_replace() function : usage variations - unexpected type arg 1 ---FILE-- -<?php -/* Prototype : proto string eregi_replace(string pattern, string replacement, string string) - * Description: Replace regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); - -echo "*** Testing eregi_replace() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$replacement = 'new'; -$string = 'original'; - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for pattern - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( eregi_replace($value, $replacement, $string) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing eregi_replace() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(64) -Error: 8 - Undefined variable: unset_var, %s(67) - -Arg value 0 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace(): REG_EMPTY, %s(74) -bool(false) - -Arg value 1 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "original" - -Arg value 12345 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "original" - -Arg value -2345 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "original" - -Arg value 10.5 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "original" - -Arg value -10.5 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "original" - -Arg value 101234567000 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "original" - -Arg value 1.07654321E-9 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace(): REG_EMPTY, %s(74) -bool(false) - -Arg value 0.5 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace(): REG_EMPTY, %s(74) -bool(false) -Error: 8 - Array to string conversion, %seregi_replace_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace(): REG_EMPTY, %s(74) -bool(false) -Error: 8 - Array to string conversion, %seregi_replace_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "original" -Error: 8 - Array to string conversion, %seregi_replace_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "original" -Error: 8 - Array to string conversion, %seregi_replace_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "original" -Error: 8 - Array to string conversion, %seregi_replace_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "original" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace(): REG_EMPTY, %s(74) -bool(false) - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace(): REG_EMPTY, %s(74) -bool(false) - -Arg value 1 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "original" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace(): REG_EMPTY, %s(74) -bool(false) - -Arg value 1 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "original" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace(): REG_EMPTY, %s(74) -bool(false) - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace(): REG_EMPTY, %s(74) -bool(false) - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace(): REG_EMPTY, %s(74) -bool(false) -Error: 4096 - Object of class stdClass could not be converted to string, %s(73) - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 8 - Object of class stdClass could not be converted to int, %s(74) -string(8) "original" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace(): REG_EMPTY, %s(74) -bool(false) - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace(): REG_EMPTY, %s(74) -bool(false) -Done diff --git a/ext/ereg/tests/eregi_replace_variation_002.phpt b/ext/ereg/tests/eregi_replace_variation_002.phpt deleted file mode 100644 index 46229e0f57..0000000000 --- a/ext/ereg/tests/eregi_replace_variation_002.phpt +++ /dev/null @@ -1,193 +0,0 @@ ---TEST-- -Test eregi_replace() function : usage variations - unexpected type arg 2 ---FILE-- -<?php -/* Prototype : proto string eregi_replace(string pattern, string replacement, string string) - * Description: Replace regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); - -echo "*** Testing eregi_replace() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$pattern = b'ell'; -$string = 'hello!'; - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for replacement - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump(urlencode(eregi_replace($pattern, $value, $string))); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing eregi_replace() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(64) -Error: 8 - Undefined variable: unset_var, %s(67) - -Arg value 0 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(5) "ho%21" - -Arg value 1 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "h%01o%21" - -Arg value 12345 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(6) "h9o%21" - -Arg value -2345 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "h%D7o%21" - -Arg value 10.5 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "h%0Ao%21" - -Arg value -10.5 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "h%F6o%21" - -Arg value 101234567000 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(%d) "h%so%21" - -Arg value 1.07654321E-9 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(5) "ho%21" - -Arg value 0.5 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(5) "ho%21" -Error: 8 - Array to string conversion, %seregi_replace_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(5) "ho%21" -Error: 8 - Array to string conversion, %seregi_replace_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "h%01o%21" -Error: 8 - Array to string conversion, %seregi_replace_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "h%01o%21" -Error: 8 - Array to string conversion, %seregi_replace_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "h%01o%21" -Error: 8 - Array to string conversion, %seregi_replace_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "h%01o%21" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(5) "ho%21" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(5) "ho%21" - -Arg value 1 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "h%01o%21" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(5) "ho%21" - -Arg value 1 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(8) "h%01o%21" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(5) "ho%21" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(5) "ho%21" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(5) "ho%21" -Error: 4096 - Object of class stdClass could not be converted to string, %s(73) - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 8 - Object of class stdClass could not be converted to int, %s(74) -string(8) "h%01o%21" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(5) "ho%21" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(5) "ho%21" -Done
\ No newline at end of file diff --git a/ext/ereg/tests/eregi_replace_variation_003.phpt b/ext/ereg/tests/eregi_replace_variation_003.phpt deleted file mode 100644 index ae9edba829..0000000000 --- a/ext/ereg/tests/eregi_replace_variation_003.phpt +++ /dev/null @@ -1,198 +0,0 @@ ---TEST-- -Test eregi_replace() function : usage variations - unexpected type arg 3 ---FILE-- -<?php -/* Prototype : proto string eregi_replace(string pattern, string replacement, string string) - * Description: Replace regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); - -echo "*** Testing eregi_replace() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$pattern = '1'; -$replacement = 'new value'; - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for string - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( eregi_replace($pattern, $replacement, $value) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing eregi_replace() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(64) -Error: 8 - Undefined variable: unset_var, %s(67) - -Arg value 0 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(1) "0" - -Arg value 1 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(9) "new value" - -Arg value 12345 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(13) "new value2345" - -Arg value -2345 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(5) "-2345" - -Arg value 10.5 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(12) "new value0.5" - -Arg value -10.5 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(13) "-new value0.5" - -Arg value 101234567000 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(28) "new value0new value234567000" - -Arg value 1.07654321E-9 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(29) "new value.0765432new valueE-9" - -Arg value 0.5 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(3) "0.5" -Error: 8 - Array to string conversion, %seregi_replace_variation_003.php(%d) - -Arg value Array -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace() expects parameter 3 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %seregi_replace_variation_003.php(%d) - -Arg value Array -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace() expects parameter 3 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %seregi_replace_variation_003.php(%d) - -Arg value Array -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace() expects parameter 3 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %seregi_replace_variation_003.php(%d) - -Arg value Array -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace() expects parameter 3 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %seregi_replace_variation_003.php(%d) - -Arg value Array -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace() expects parameter 3 to be string, array given, %s(74) -NULL - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(0) "" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(0) "" - -Arg value 1 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(9) "new value" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(0) "" - -Arg value 1 -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(9) "new value" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(0) "" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(0) "" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(0) "" -Error: 4096 - Object of class stdClass could not be converted to string, %s(73) - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -Error: 2 - eregi_replace() expects parameter 3 to be string, object given, %s(74) -NULL - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(0) "" - -Arg value -Error: 8192 - Function eregi_replace() is deprecated, %s(74) -string(0) "" -Done diff --git a/ext/ereg/tests/eregi_variation_001.phpt b/ext/ereg/tests/eregi_variation_001.phpt deleted file mode 100644 index 38c2cbaef3..0000000000 --- a/ext/ereg/tests/eregi_variation_001.phpt +++ /dev/null @@ -1,208 +0,0 @@ ---TEST-- -Test eregi() function : usage variations - unexpected type arg 1 ---FILE-- -<?php -/* Prototype : proto int eregi(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); - - -echo "*** Testing eregi() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$string = '1'; -$registers = array(1, 2); - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for pattern - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( eregi($value, $string, $registers) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing eregi() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(65) -Error: 8 - Undefined variable: unset_var, %s(68) - -Arg value 0 -Error: 8192 - Function eregi() is deprecated, %s(75) -bool(false) - -Arg value 1 -Error: 8192 - Function eregi() is deprecated, %s(75) -int(1) - -Arg value 12345 -Error: 8192 - Function eregi() is deprecated, %s(75) -bool(false) - -Arg value -2345 -Error: 8192 - Function eregi() is deprecated, %s(75) -bool(false) - -Arg value 10.5 -Error: 8192 - Function eregi() is deprecated, %s(75) -bool(false) - -Arg value -10.5 -Error: 8192 - Function eregi() is deprecated, %s(75) -bool(false) - -Arg value 101234567000 -Error: 8192 - Function eregi() is deprecated, %s(75) -bool(false) - -Arg value 1.07654321E-9 -Error: 8192 - Function eregi() is deprecated, %s(75) -bool(false) - -Arg value 0.5 -Error: 8192 - Function eregi() is deprecated, %s(75) -bool(false) -Error: 8 - Array to string conversion, %seregi_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function eregi() is deprecated, %s(75) -Error: 8 - Array to string conversion, %s(75) -bool(false) -Error: 8 - Array to string conversion, %seregi_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function eregi() is deprecated, %s(75) -Error: 8 - Array to string conversion, %s(75) -bool(false) -Error: 8 - Array to string conversion, %seregi_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function eregi() is deprecated, %s(75) -Error: 8 - Array to string conversion, %s(75) -bool(false) -Error: 8 - Array to string conversion, %seregi_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function eregi() is deprecated, %s(75) -Error: 8 - Array to string conversion, %s(75) -bool(false) -Error: 8 - Array to string conversion, %seregi_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function eregi() is deprecated, %s(75) -Error: 8 - Array to string conversion, %s(75) -bool(false) - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(75) -Error: 2 - eregi(): REG_EMPTY, %s(75) -bool(false) - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(75) -Error: 2 - eregi(): REG_EMPTY, %s(75) -bool(false) - -Arg value 1 -Error: 8192 - Function eregi() is deprecated, %s(75) -int(1) - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(75) -Error: 2 - eregi(): REG_EMPTY, %s(75) -bool(false) - -Arg value 1 -Error: 8192 - Function eregi() is deprecated, %s(75) -int(1) - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(75) -Error: 2 - eregi(): REG_EMPTY, %s(75) -bool(false) - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(75) -Error: 2 - eregi(): REG_EMPTY, %s(75) -bool(false) - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(75) -Error: 2 - eregi(): REG_EMPTY, %s(75) -bool(false) -Error: 4096 - Object of class stdClass could not be converted to string, %s(74) - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(75) -Error: 4096 - Object of class stdClass could not be converted to string, %s(75) -Error: 8 - Object of class stdClass to string conversion, %s(75) -bool(false) - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(75) -Error: 2 - eregi(): REG_EMPTY, %s(75) -bool(false) - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(75) -Error: 2 - eregi(): REG_EMPTY, %s(75) -bool(false) -Done diff --git a/ext/ereg/tests/eregi_variation_002.phpt b/ext/ereg/tests/eregi_variation_002.phpt deleted file mode 100644 index 8e803b55fa..0000000000 --- a/ext/ereg/tests/eregi_variation_002.phpt +++ /dev/null @@ -1,198 +0,0 @@ ---TEST-- -Test eregi() function : usage variations - unexpected type arg 2 ---FILE-- -<?php -/* Prototype : proto int eregi(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); - -echo "*** Testing eregi() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$pattern = '1'; -$registers = array(); - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for string - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( eregi($pattern, $value, $registers) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing eregi() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(64) -Error: 8 - Undefined variable: unset_var, %s(67) - -Arg value 0 -Error: 8192 - Function eregi() is deprecated, %s(74) -bool(false) - -Arg value 1 -Error: 8192 - Function eregi() is deprecated, %s(74) -int(1) - -Arg value 12345 -Error: 8192 - Function eregi() is deprecated, %s(74) -int(1) - -Arg value -2345 -Error: 8192 - Function eregi() is deprecated, %s(74) -bool(false) - -Arg value 10.5 -Error: 8192 - Function eregi() is deprecated, %s(74) -int(1) - -Arg value -10.5 -Error: 8192 - Function eregi() is deprecated, %s(74) -int(1) - -Arg value 101234567000 -Error: 8192 - Function eregi() is deprecated, %s(74) -int(1) - -Arg value 1.07654321E-9 -Error: 8192 - Function eregi() is deprecated, %s(74) -int(1) - -Arg value 0.5 -Error: 8192 - Function eregi() is deprecated, %s(74) -bool(false) -Error: 8 - Array to string conversion, %seregi_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function eregi() is deprecated, %s(74) -Error: 2 - eregi() expects parameter 2 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %seregi_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function eregi() is deprecated, %s(74) -Error: 2 - eregi() expects parameter 2 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %seregi_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function eregi() is deprecated, %s(74) -Error: 2 - eregi() expects parameter 2 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %seregi_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function eregi() is deprecated, %s(74) -Error: 2 - eregi() expects parameter 2 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %seregi_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function eregi() is deprecated, %s(74) -Error: 2 - eregi() expects parameter 2 to be string, array given, %s(74) -NULL - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(74) -bool(false) - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(74) -bool(false) - -Arg value 1 -Error: 8192 - Function eregi() is deprecated, %s(74) -int(1) - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(74) -bool(false) - -Arg value 1 -Error: 8192 - Function eregi() is deprecated, %s(74) -int(1) - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(74) -bool(false) - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(74) -bool(false) - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(74) -bool(false) -Error: 4096 - Object of class stdClass could not be converted to string, %s(73) - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(74) -Error: 2 - eregi() expects parameter 2 to be string, object given, %s(74) -NULL - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(74) -bool(false) - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(74) -bool(false) -Done diff --git a/ext/ereg/tests/eregi_variation_003.phpt b/ext/ereg/tests/eregi_variation_003.phpt deleted file mode 100644 index 97777e22ff..0000000000 --- a/ext/ereg/tests/eregi_variation_003.phpt +++ /dev/null @@ -1,305 +0,0 @@ ---TEST-- -Test eregi() function : usage variations - unexpected type for arg 3 ---FILE-- -<?php -/* Prototype : proto int eregi(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); - -echo "*** Testing eregi() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$pattern = 'h(.*)lo!'; -$string = 'hello!'; - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // 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 registers - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( eregi($pattern, $string, $value) ); - var_dump($value); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing eregi() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(61) -Error: 8 - Undefined variable: unset_var, %s(64) - -Arg value 0 -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value 1 -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value 12345 -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -2345 -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value 10.5 -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -10.5 -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value 101234567000 -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value 1.07654321E-9 -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value 0.5 -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value 1 -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value 1 -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value string -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value string -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} -Error: 4096 - Object of class stdClass could not be converted to string, %s(70) - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} - -Arg value -Error: 8192 - Function eregi() is deprecated, %s(71) -int(6) -array(2) { - [0]=> - string(6) "hello!" - [1]=> - string(2) "el" -} -Done diff --git a/ext/ereg/tests/eregi_variation_004.phpt b/ext/ereg/tests/eregi_variation_004.phpt deleted file mode 100644 index 7378c36d3d..0000000000 --- a/ext/ereg/tests/eregi_variation_004.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Test eregi() function : usage variations - pass non-variable as arg 3, which is pass-by-ref. ---FILE-- -<?php -/* Prototype : proto int eregi(string pattern, string string [, array registers]) - * Description: Regular expression match - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -var_dump(eregi('l{2}', 'hello', str_repeat('x',1))); -echo "Done"; -?> ---EXPECTF-- -Strict Standards: Only variables should be passed by reference in %s on line %d - -Deprecated: Function eregi() is deprecated in %s on line %d -int(2) -Done diff --git a/ext/ereg/tests/regular_expressions.inc b/ext/ereg/tests/regular_expressions.inc deleted file mode 100644 index 98fae4b112..0000000000 --- a/ext/ereg/tests/regular_expressions.inc +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/** - * POSIX regular expressions each coupled with a string that they match, - * based on documentation on http://www.tin.org/bin/man.cgi?section=7&topic=regex . - */ -$expressions = array( - //array(pattern, string to match) - array('..(a|b|c)(a|b|c)..', '--- ab ---'), - array('()', ''), - array('()', 'abcdef'), - array('[x]|[^x]', 'abcdef'), - array('(a{1})(a{1,}) (b{1,3}) (c+) (d?ddd|e)', '--- aaa bbb ccc ddd ---'), - array('\\\\\`\^\.\[\$\(\)\|\*\+\?\{\\\'', '\\`^.[$()|*+?{\''), - array('\\a', 'a'), - array('[0-9][^0-9]', '2a'), - array('^[[:alnum:]]{62,62}$', '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), - array('^[[:digit:]]{5}', '0123456789'), - array('[[:digit:]]{5}$', '0123456789'), - array('[[:blank:]]{1,10}', "\n \t"), - array('[[:print:]]{3}', " a "), -); - -?>
\ No newline at end of file diff --git a/ext/ereg/tests/split_basic_001.phpt b/ext/ereg/tests/split_basic_001.phpt deleted file mode 100644 index 1c11f71ca8..0000000000 --- a/ext/ereg/tests/split_basic_001.phpt +++ /dev/null @@ -1,155 +0,0 @@ ---TEST-- -Test split() function : basic functionality - test a number of simple split, specifying a limit ---FILE-- -<?php -/* Prototype : proto array split(string pattern, string string [, int limit]) - * Description: Split string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test a number of simple split, specifying a limit - */ - -echo "*** Testing ereg() : basic functionality ***\n"; - -include(dirname(__FILE__) . '/regular_expressions.inc'); - -foreach ($expressions as $re) { - list($pattern,$string) = $re; - echo "\n--> Pattern: '$pattern'; match: '$string'\n"; - var_dump(split($pattern, $string . ' |1| ' . $string . ' |2| ' . $string, 2)); -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg() : basic functionality *** - ---> Pattern: '..(a|b|c)(a|b|c)..'; match: '--- ab ---' - -Deprecated: Function split() is deprecated in %s on line %d -array(2) { - [0]=> - string(2) "--" - [1]=> - string(32) "-- |1| --- ab --- |2| --- ab ---" -} - ---> Pattern: '()'; match: '' - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split(): Invalid Regular Expression in %s on line %d -bool(false) - ---> Pattern: '()'; match: 'abcdef' - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split(): Invalid Regular Expression in %s on line %d -bool(false) - ---> Pattern: '[x]|[^x]'; match: 'abcdef' - -Deprecated: Function split() is deprecated in %s on line %d -array(2) { - [0]=> - string(0) "" - [1]=> - string(27) "bcdef |1| abcdef |2| abcdef" -} - ---> Pattern: '(a{1})(a{1,}) (b{1,3}) (c+) (d?ddd|e)'; match: '--- aaa bbb ccc ddd ---' - -Deprecated: Function split() is deprecated in %s on line %d -array(2) { - [0]=> - string(4) "--- " - [1]=> - string(60) " --- |1| --- aaa bbb ccc ddd --- |2| --- aaa bbb ccc ddd ---" -} - ---> Pattern: '\\\`\^\.\[\$\(\)\|\*\+\?\{\''; match: '\`^.[$()|*+?{'' - -Deprecated: Function split() is deprecated in %s on line %d -array(2) { - [0]=> - string(0) "" - [1]=> - string(38) " |1| \`^.[$()|*+?{' |2| \`^.[$()|*+?{'" -} - ---> Pattern: '\a'; match: 'a' - -Deprecated: Function split() is deprecated in %s on line %d -array(2) { - [0]=> - string(0) "" - [1]=> - string(12) " |1| a |2| a" -} - ---> Pattern: '[0-9][^0-9]'; match: '2a' - -Deprecated: Function split() is deprecated in %s on line %d -array(2) { - [0]=> - string(0) "" - [1]=> - string(14) " |1| 2a |2| 2a" -} - ---> Pattern: '^[[:alnum:]]{62,62}$'; match: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' - -Deprecated: Function split() is deprecated in %s on line %d -array(1) { - [0]=> - string(196) "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ |1| 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ |2| 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" -} - ---> Pattern: '^[[:digit:]]{5}'; match: '0123456789' - -Deprecated: Function split() is deprecated in %s on line %d -array(2) { - [0]=> - string(0) "" - [1]=> - string(35) "56789 |1| 0123456789 |2| 0123456789" -} - ---> Pattern: '[[:digit:]]{5}$'; match: '0123456789' - -Deprecated: Function split() is deprecated in %s on line %d -array(2) { - [0]=> - string(35) "0123456789 |1| 0123456789 |2| 01234" - [1]=> - string(0) "" -} - ---> Pattern: '[[:blank:]]{1,10}'; match: ' - ' - -Deprecated: Function split() is deprecated in %s on line %d -array(2) { - [0]=> - string(1) " -" - [1]=> - string(15) "|1| - |2| - " -} - ---> Pattern: '[[:print:]]{3}'; match: ' a ' - -Deprecated: Function split() is deprecated in %s on line %d -array(2) { - [0]=> - string(0) "" - [1]=> - string(16) " |1| a |2| a " -} -Done diff --git a/ext/ereg/tests/split_basic_002.phpt b/ext/ereg/tests/split_basic_002.phpt deleted file mode 100644 index 443a6b6b92..0000000000 --- a/ext/ereg/tests/split_basic_002.phpt +++ /dev/null @@ -1,253 +0,0 @@ ---TEST-- -Test split() function : basic functionality - test a number of simple split, without specifying a limit ---FILE-- -<?php -/* Prototype : proto array split(string pattern, string string [, int limit]) - * Description: Split string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test a number of simple split, without specifying a limit - */ - -echo "*** Testing ereg() : basic functionality ***\n"; - -include(dirname(__FILE__) . '/regular_expressions.inc'); - -foreach ($expressions as $re) { - list($pattern,$string) = $re; - echo "\n--> Pattern: '$pattern'; match: '$string'\n"; - var_dump(split($pattern, $string . ' |1| ' . $string . ' |2| ' . $string)); -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg() : basic functionality *** - ---> Pattern: '..(a|b|c)(a|b|c)..'; match: '--- ab ---' - -Deprecated: Function split() is deprecated in %s on line %d -array(4) { - [0]=> - string(2) "--" - [1]=> - string(9) "-- |1| --" - [2]=> - string(9) "-- |2| --" - [3]=> - string(2) "--" -} - ---> Pattern: '()'; match: '' - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split(): Invalid Regular Expression in %s on line %d -bool(false) - ---> Pattern: '()'; match: 'abcdef' - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split(): Invalid Regular Expression in %s on line %d -bool(false) - ---> Pattern: '[x]|[^x]'; match: 'abcdef' - -Deprecated: Function split() is deprecated in %s on line %d -array(29) { - [0]=> - string(0) "" - [1]=> - string(0) "" - [2]=> - string(0) "" - [3]=> - string(0) "" - [4]=> - string(0) "" - [5]=> - string(0) "" - [6]=> - string(0) "" - [7]=> - string(0) "" - [8]=> - string(0) "" - [9]=> - string(0) "" - [10]=> - string(0) "" - [11]=> - string(0) "" - [12]=> - string(0) "" - [13]=> - string(0) "" - [14]=> - string(0) "" - [15]=> - string(0) "" - [16]=> - string(0) "" - [17]=> - string(0) "" - [18]=> - string(0) "" - [19]=> - string(0) "" - [20]=> - string(0) "" - [21]=> - string(0) "" - [22]=> - string(0) "" - [23]=> - string(0) "" - [24]=> - string(0) "" - [25]=> - string(0) "" - [26]=> - string(0) "" - [27]=> - string(0) "" - [28]=> - string(0) "" -} - ---> Pattern: '(a{1})(a{1,}) (b{1,3}) (c+) (d?ddd|e)'; match: '--- aaa bbb ccc ddd ---' - -Deprecated: Function split() is deprecated in %s on line %d -array(4) { - [0]=> - string(4) "--- " - [1]=> - string(13) " --- |1| --- " - [2]=> - string(13) " --- |2| --- " - [3]=> - string(4) " ---" -} - ---> Pattern: '\\\`\^\.\[\$\(\)\|\*\+\?\{\''; match: '\`^.[$()|*+?{'' - -Deprecated: Function split() is deprecated in %s on line %d -array(4) { - [0]=> - string(0) "" - [1]=> - string(5) " |1| " - [2]=> - string(5) " |2| " - [3]=> - string(0) "" -} - ---> Pattern: '\a'; match: 'a' - -Deprecated: Function split() is deprecated in %s on line %d -array(4) { - [0]=> - string(0) "" - [1]=> - string(5) " |1| " - [2]=> - string(5) " |2| " - [3]=> - string(0) "" -} - ---> Pattern: '[0-9][^0-9]'; match: '2a' - -Deprecated: Function split() is deprecated in %s on line %d -array(6) { - [0]=> - string(0) "" - [1]=> - string(2) " |" - [2]=> - string(1) " " - [3]=> - string(2) " |" - [4]=> - string(1) " " - [5]=> - string(0) "" -} - ---> Pattern: '^[[:alnum:]]{62,62}$'; match: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' - -Deprecated: Function split() is deprecated in %s on line %d -array(1) { - [0]=> - string(196) "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ |1| 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ |2| 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" -} - ---> Pattern: '^[[:digit:]]{5}'; match: '0123456789' - -Deprecated: Function split() is deprecated in %s on line %d -array(3) { - [0]=> - string(0) "" - [1]=> - string(0) "" - [2]=> - string(30) " |1| 0123456789 |2| 0123456789" -} - ---> Pattern: '[[:digit:]]{5}$'; match: '0123456789' - -Deprecated: Function split() is deprecated in %s on line %d -array(2) { - [0]=> - string(35) "0123456789 |1| 0123456789 |2| 01234" - [1]=> - string(0) "" -} - ---> Pattern: '[[:blank:]]{1,10}'; match: ' - ' - -Deprecated: Function split() is deprecated in %s on line %d -array(6) { - [0]=> - string(1) " -" - [1]=> - string(3) "|1|" - [2]=> - string(1) " -" - [3]=> - string(3) "|2|" - [4]=> - string(1) " -" - [5]=> - string(0) "" -} - ---> Pattern: '[[:print:]]{3}'; match: ' a ' - -Deprecated: Function split() is deprecated in %s on line %d -array(7) { - [0]=> - string(0) "" - [1]=> - string(0) "" - [2]=> - string(0) "" - [3]=> - string(0) "" - [4]=> - string(0) "" - [5]=> - string(0) "" - [6]=> - string(1) " " -} -Done diff --git a/ext/ereg/tests/split_basic_003.phpt b/ext/ereg/tests/split_basic_003.phpt deleted file mode 100644 index 8767144f7d..0000000000 --- a/ext/ereg/tests/split_basic_003.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -Test split() function : basic functionality - a few non-matches ---FILE-- -<?php -/* Prototype : proto array split(string pattern, string string [, int limit]) - * Description: split string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -$replacement = 'r'; - -var_dump(split('A', '-- a --')); -var_dump(split('[A-Z]', '-- 0 --')); -var_dump(split('(a){4}', '--- aaa ---')); -var_dump(split('^a', '--- ba ---')); -var_dump(split('b$', '--- ba ---')); -var_dump(split('[:alpha:]', '--- x ---')); - - -echo "Done"; -?> ---EXPECTF-- -Deprecated: Function split() is deprecated in %s on line %d -array(1) { - [0]=> - string(7) "-- a --" -} - -Deprecated: Function split() is deprecated in %s on line %d -array(1) { - [0]=> - string(7) "-- 0 --" -} - -Deprecated: Function split() is deprecated in %s on line %d -array(1) { - [0]=> - string(11) "--- aaa ---" -} - -Deprecated: Function split() is deprecated in %s on line %d -array(1) { - [0]=> - string(10) "--- ba ---" -} - -Deprecated: Function split() is deprecated in %s on line %d -array(1) { - [0]=> - string(10) "--- ba ---" -} - -Deprecated: Function split() is deprecated in %s on line %d -array(1) { - [0]=> - string(9) "--- x ---" -} -Done diff --git a/ext/ereg/tests/split_error_001.phpt b/ext/ereg/tests/split_error_001.phpt deleted file mode 100644 index 2575717a22..0000000000 --- a/ext/ereg/tests/split_error_001.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test split() function : error conditions - wrong number of args ---FILE-- -<?php -/* Prototype : proto array split(string pattern, string string [, int limit]) - * Description: Split string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -echo "*** Testing split() : error conditions - wrong number of args ***\n"; - - -//Test split with one more than the expected number of arguments -echo "\n-- Testing split() function with more than expected no. of arguments --\n"; -$pattern = 'string_val'; -$string = 'string_val'; -$limit = 10; -$extra_arg = 10; -var_dump( split($pattern, $string, $limit, $extra_arg) ); - -// Testing split with one less than the expected number of arguments -echo "\n-- Testing split() function with less than expected no. of arguments --\n"; -$pattern = 'string_val'; -var_dump( split($pattern) ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing split() : error conditions - wrong number of args *** - --- Testing split() function with more than expected no. of arguments -- - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split() expects at most 3 parameters, 4 given in %s on line %d -NULL - --- Testing split() function with less than expected no. of arguments -- - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split() expects at least 2 parameters, 1 given in %s on line %d -NULL -Done diff --git a/ext/ereg/tests/split_error_002.phpt b/ext/ereg/tests/split_error_002.phpt deleted file mode 100644 index 9eaac59e44..0000000000 --- a/ext/ereg/tests/split_error_002.phpt +++ /dev/null @@ -1,118 +0,0 @@ ---TEST-- -Test split() function : error conditions - test bad regular expressions ---FILE-- -<?php -/* Prototype : proto array split(string pattern, string string [, int limit]) - * Description: Split string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test bad regular expressions - */ - -echo "*** Testing split() : error conditions ***\n"; - -$regs = 'original'; - -var_dump(split("", "hello")); -var_dump(split("c(d", "hello")); -var_dump(split("a[b", "hello")); -var_dump(split("c(d", "hello")); -var_dump(split("*", "hello")); -var_dump(split("+", "hello")); -var_dump(split("?", "hello")); -var_dump(split("(+?*)", "hello", $regs)); -var_dump(split("h{256}", "hello")); -var_dump(split("h|", "hello")); -var_dump(split("h{0}", "hello")); -var_dump(split("h{2,1}", "hello")); -var_dump(split('[a-c-e]', 'd')); -var_dump(split('\\', 'x')); -var_dump(split('([9-0])', '1', $regs)); - -//ensure $regs unchanged -var_dump($regs); - -echo "Done"; -?> ---EXPECTF-- -*** Testing split() : error conditions *** - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split(): REG_EPAREN in %s on line %d -bool(false) - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split(): REG_EBRACK in %s on line %d -bool(false) - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split(): REG_EPAREN in %s on line %d -bool(false) - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split() expects parameter 3 to be long, string given in %s on line %d -NULL - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split(): REG_BADBR in %s on line %d -bool(false) - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split(): REG_BADBR in %s on line %d -bool(false) - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split(): REG_ERANGE in %s on line %d -bool(false) - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split(): REG_EESCAPE in %s on line %d -bool(false) - -Deprecated: Function split() is deprecated in %s on line %d - -Warning: split() expects parameter 3 to be long, string given in %s on line %d -NULL -string(8) "original" -Done diff --git a/ext/ereg/tests/split_variation_001.phpt b/ext/ereg/tests/split_variation_001.phpt deleted file mode 100644 index 9d9fc9d518..0000000000 --- a/ext/ereg/tests/split_variation_001.phpt +++ /dev/null @@ -1,257 +0,0 @@ ---TEST-- -Test split() function : usage variations - unexpected type for arg 1 ---FILE-- -<?php -/* Prototype : proto array split(string pattern, string string [, int limit]) - * Description: Split string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); - -echo "*** Testing split() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$string = '1 a 1 Array 1 c '; -$limit = 5; - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for pattern - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( split($value, $string, $limit) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing split() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(64) -Error: 8 - Undefined variable: unset_var, %s(67) - -Arg value 0 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(16) "1 a 1 Array 1 c " -} - -Arg value 1 -Error: 8192 - Function split() is deprecated, %s(74) -array(4) { - [0]=> - string(0) "" - [1]=> - string(3) " a " - [2]=> - string(7) " Array " - [3]=> - string(3) " c " -} - -Arg value 12345 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(16) "1 a 1 Array 1 c " -} - -Arg value -2345 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(16) "1 a 1 Array 1 c " -} - -Arg value 10.5 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(16) "1 a 1 Array 1 c " -} - -Arg value -10.5 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(16) "1 a 1 Array 1 c " -} - -Arg value 101234567000 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(16) "1 a 1 Array 1 c " -} - -Arg value 1.07654321E-9 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(16) "1 a 1 Array 1 c " -} - -Arg value 0.5 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(16) "1 a 1 Array 1 c " -} -Error: 8 - Array to string conversion, %ssplit_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split() expects parameter 1 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %ssplit_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split() expects parameter 1 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %ssplit_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split() expects parameter 1 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %ssplit_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split() expects parameter 1 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %ssplit_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split(): REG_EMPTY, %s(74) -bool(false) - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split(): REG_EMPTY, %s(74) -bool(false) - -Arg value 1 -Error: 8192 - Function split() is deprecated, %s(74) -array(4) { - [0]=> - string(0) "" - [1]=> - string(3) " a " - [2]=> - string(7) " Array " - [3]=> - string(3) " c " -} - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split(): REG_EMPTY, %s(74) -bool(false) - -Arg value 1 -Error: 8192 - Function split() is deprecated, %s(74) -array(4) { - [0]=> - string(0) "" - [1]=> - string(3) " a " - [2]=> - string(7) " Array " - [3]=> - string(3) " c " -} - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split(): REG_EMPTY, %s(74) -bool(false) - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split(): REG_EMPTY, %s(74) -bool(false) - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split(): REG_EMPTY, %s(74) -bool(false) -Error: 4096 - Object of class stdClass could not be converted to string, %s(73) - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split() expects parameter 1 to be string, object given, %s(74) -NULL - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split(): REG_EMPTY, %s(74) -bool(false) - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split(): REG_EMPTY, %s(74) -bool(false) -Done diff --git a/ext/ereg/tests/split_variation_002.phpt b/ext/ereg/tests/split_variation_002.phpt deleted file mode 100644 index b1ea57c787..0000000000 --- a/ext/ereg/tests/split_variation_002.phpt +++ /dev/null @@ -1,257 +0,0 @@ ---TEST-- -Test split() function : usage variations - unexpected type for arg 2 ---FILE-- -<?php -/* Prototype : proto array split(string pattern, string string [, int limit]) - * Description: Split string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); - -echo "*** Testing split() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$pattern = 'r|j|E'; -$limit = 5; - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for string - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( split($pattern, $value, $limit) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing split() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(64) -Error: 8 - Undefined variable: unset_var, %s(67) - -Arg value 0 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(1) "0" -} - -Arg value 1 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(1) "1" -} - -Arg value 12345 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(5) "12345" -} - -Arg value -2345 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(5) "-2345" -} - -Arg value 10.5 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(4) "10.5" -} - -Arg value -10.5 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(5) "-10.5" -} - -Arg value 101234567000 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(12) "101234567000" -} - -Arg value 1.07654321E-9 -Error: 8192 - Function split() is deprecated, %s(74) -array(2) { - [0]=> - string(10) "1.07654321" - [1]=> - string(2) "-9" -} - -Arg value 0.5 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(3) "0.5" -} -Error: 8 - Array to string conversion, %ssplit_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split() expects parameter 2 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %ssplit_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split() expects parameter 2 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %ssplit_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split() expects parameter 2 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %ssplit_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split() expects parameter 2 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %ssplit_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split() expects parameter 2 to be string, array given, %s(74) -NULL - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(0) "" -} - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(0) "" -} - -Arg value 1 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(1) "1" -} - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(0) "" -} - -Arg value 1 -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(1) "1" -} - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(0) "" -} - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(0) "" -} - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(0) "" -} -Error: 4096 - Object of class stdClass could not be converted to string, %s(73) - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -Error: 2 - split() expects parameter 2 to be string, object given, %s(74) -NULL - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(0) "" -} - -Arg value -Error: 8192 - Function split() is deprecated, %s(74) -array(1) { - [0]=> - string(0) "" -} -Done diff --git a/ext/ereg/tests/split_variation_003.phpt b/ext/ereg/tests/split_variation_003.phpt deleted file mode 100644 index edef9cfeb9..0000000000 --- a/ext/ereg/tests/split_variation_003.phpt +++ /dev/null @@ -1,231 +0,0 @@ ---TEST-- -Test split() function : usage variations - unexpected type for arg 3 ---FILE-- -<?php -/* Prototype : proto array split(string pattern, string string [, int limit]) - * Description: Split string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - if (error_reporting() != 0) { - // report non-silenced errors - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; - } -} -set_error_handler('test_error_handler'); -echo "*** Testing split() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$pattern = b'[[:space:]]'; -$string = '1 2 3 4 5'; - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // float data - 10.5, - -10.5, - 10.7654321E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => '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 diff --git a/ext/ereg/tests/split_variation_004.phpt b/ext/ereg/tests/split_variation_004.phpt deleted file mode 100644 index d3d2de84a3..0000000000 --- a/ext/ereg/tests/split_variation_004.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Test split() function : usage variations - out-of-range values for limit ---FILE-- -<?php -/* Prototype : proto array split(string pattern, string string [, int limit]) - * Description: Split string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); -echo "*** Testing split() : usage variations ***\n"; - -$pattern = '[[:space:]]'; -$string = '1 2 3 4 5'; -var_dump(split($pattern, $string, 0)); -var_dump(split($pattern, $string, -10)); - - -echo "Done"; -?> ---EXPECTF-- -*** Testing split() : usage variations *** -Error: 8192 - Function split() is deprecated, %s(16) -array(1) { - [0]=> - string(9) "1 2 3 4 5" -} -Error: 8192 - Function split() is deprecated, %s(17) -array(1) { - [0]=> - string(9) "1 2 3 4 5" -} -Done diff --git a/ext/ereg/tests/spliti_basic_001.phpt b/ext/ereg/tests/spliti_basic_001.phpt deleted file mode 100644 index 743bd66212..0000000000 --- a/ext/ereg/tests/spliti_basic_001.phpt +++ /dev/null @@ -1,155 +0,0 @@ ---TEST-- -Test spliti() function : basic functionality - test a number of simple spliti, specifying a limit ---FILE-- -<?php -/* Prototype : proto array spliti(string pattern, string string [, int limit]) - * Description: spliti string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test a number of simple spliti, specifying a limit - */ - -echo "*** Testing ereg() : basic functionality ***\n"; - -include(dirname(__FILE__) . '/regular_expressions.inc'); - -foreach ($expressions as $re) { - list($pattern,$string) = $re; - echo "\n--> Pattern: '$pattern'; match: '$string'\n"; - var_dump(spliti($pattern, $string . ' |1| ' . $string . ' |2| ' . $string, 2)); -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg() : basic functionality *** - ---> Pattern: '..(a|b|c)(a|b|c)..'; match: '--- ab ---' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(2) { - [0]=> - string(2) "--" - [1]=> - string(32) "-- |1| --- ab --- |2| --- ab ---" -} - ---> Pattern: '()'; match: '' - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti(): Invalid Regular Expression in %s on line %d -bool(false) - ---> Pattern: '()'; match: 'abcdef' - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti(): Invalid Regular Expression in %s on line %d -bool(false) - ---> Pattern: '[x]|[^x]'; match: 'abcdef' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(2) { - [0]=> - string(0) "" - [1]=> - string(27) "bcdef |1| abcdef |2| abcdef" -} - ---> Pattern: '(a{1})(a{1,}) (b{1,3}) (c+) (d?ddd|e)'; match: '--- aaa bbb ccc ddd ---' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(2) { - [0]=> - string(4) "--- " - [1]=> - string(60) " --- |1| --- aaa bbb ccc ddd --- |2| --- aaa bbb ccc ddd ---" -} - ---> Pattern: '\\\`\^\.\[\$\(\)\|\*\+\?\{\''; match: '\`^.[$()|*+?{'' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(2) { - [0]=> - string(0) "" - [1]=> - string(38) " |1| \`^.[$()|*+?{' |2| \`^.[$()|*+?{'" -} - ---> Pattern: '\a'; match: 'a' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(2) { - [0]=> - string(0) "" - [1]=> - string(12) " |1| a |2| a" -} - ---> Pattern: '[0-9][^0-9]'; match: '2a' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(2) { - [0]=> - string(0) "" - [1]=> - string(14) " |1| 2a |2| 2a" -} - ---> Pattern: '^[[:alnum:]]{62,62}$'; match: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(1) { - [0]=> - string(196) "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ |1| 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ |2| 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" -} - ---> Pattern: '^[[:digit:]]{5}'; match: '0123456789' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(2) { - [0]=> - string(0) "" - [1]=> - string(35) "56789 |1| 0123456789 |2| 0123456789" -} - ---> Pattern: '[[:digit:]]{5}$'; match: '0123456789' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(2) { - [0]=> - string(35) "0123456789 |1| 0123456789 |2| 01234" - [1]=> - string(0) "" -} - ---> Pattern: '[[:blank:]]{1,10}'; match: ' - ' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(2) { - [0]=> - string(1) " -" - [1]=> - string(15) "|1| - |2| - " -} - ---> Pattern: '[[:print:]]{3}'; match: ' a ' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(2) { - [0]=> - string(0) "" - [1]=> - string(16) " |1| a |2| a " -} -Done diff --git a/ext/ereg/tests/spliti_basic_002.phpt b/ext/ereg/tests/spliti_basic_002.phpt deleted file mode 100644 index df61a42cae..0000000000 --- a/ext/ereg/tests/spliti_basic_002.phpt +++ /dev/null @@ -1,253 +0,0 @@ ---TEST-- -Test spliti() function : basic functionality - test a number of simple spliti, without specifying a limit ---FILE-- -<?php -/* Prototype : proto array spliti(string pattern, string string [, int limit]) - * Description: spliti string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test a number of simple spliti, without specifying a limit - */ - -echo "*** Testing ereg() : basic functionality ***\n"; - -include(dirname(__FILE__) . '/regular_expressions.inc'); - -foreach ($expressions as $re) { - list($pattern,$string) = $re; - echo "\n--> Pattern: '$pattern'; match: '$string'\n"; - var_dump(spliti($pattern, $string . ' |1| ' . $string . ' |2| ' . $string)); -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing ereg() : basic functionality *** - ---> Pattern: '..(a|b|c)(a|b|c)..'; match: '--- ab ---' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(4) { - [0]=> - string(2) "--" - [1]=> - string(9) "-- |1| --" - [2]=> - string(9) "-- |2| --" - [3]=> - string(2) "--" -} - ---> Pattern: '()'; match: '' - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti(): Invalid Regular Expression in %s on line %d -bool(false) - ---> Pattern: '()'; match: 'abcdef' - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti(): Invalid Regular Expression in %s on line %d -bool(false) - ---> Pattern: '[x]|[^x]'; match: 'abcdef' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(29) { - [0]=> - string(0) "" - [1]=> - string(0) "" - [2]=> - string(0) "" - [3]=> - string(0) "" - [4]=> - string(0) "" - [5]=> - string(0) "" - [6]=> - string(0) "" - [7]=> - string(0) "" - [8]=> - string(0) "" - [9]=> - string(0) "" - [10]=> - string(0) "" - [11]=> - string(0) "" - [12]=> - string(0) "" - [13]=> - string(0) "" - [14]=> - string(0) "" - [15]=> - string(0) "" - [16]=> - string(0) "" - [17]=> - string(0) "" - [18]=> - string(0) "" - [19]=> - string(0) "" - [20]=> - string(0) "" - [21]=> - string(0) "" - [22]=> - string(0) "" - [23]=> - string(0) "" - [24]=> - string(0) "" - [25]=> - string(0) "" - [26]=> - string(0) "" - [27]=> - string(0) "" - [28]=> - string(0) "" -} - ---> Pattern: '(a{1})(a{1,}) (b{1,3}) (c+) (d?ddd|e)'; match: '--- aaa bbb ccc ddd ---' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(4) { - [0]=> - string(4) "--- " - [1]=> - string(13) " --- |1| --- " - [2]=> - string(13) " --- |2| --- " - [3]=> - string(4) " ---" -} - ---> Pattern: '\\\`\^\.\[\$\(\)\|\*\+\?\{\''; match: '\`^.[$()|*+?{'' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(4) { - [0]=> - string(0) "" - [1]=> - string(5) " |1| " - [2]=> - string(5) " |2| " - [3]=> - string(0) "" -} - ---> Pattern: '\a'; match: 'a' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(4) { - [0]=> - string(0) "" - [1]=> - string(5) " |1| " - [2]=> - string(5) " |2| " - [3]=> - string(0) "" -} - ---> Pattern: '[0-9][^0-9]'; match: '2a' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(6) { - [0]=> - string(0) "" - [1]=> - string(2) " |" - [2]=> - string(1) " " - [3]=> - string(2) " |" - [4]=> - string(1) " " - [5]=> - string(0) "" -} - ---> Pattern: '^[[:alnum:]]{62,62}$'; match: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(1) { - [0]=> - string(196) "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ |1| 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ |2| 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" -} - ---> Pattern: '^[[:digit:]]{5}'; match: '0123456789' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(3) { - [0]=> - string(0) "" - [1]=> - string(0) "" - [2]=> - string(30) " |1| 0123456789 |2| 0123456789" -} - ---> Pattern: '[[:digit:]]{5}$'; match: '0123456789' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(2) { - [0]=> - string(35) "0123456789 |1| 0123456789 |2| 01234" - [1]=> - string(0) "" -} - ---> Pattern: '[[:blank:]]{1,10}'; match: ' - ' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(6) { - [0]=> - string(1) " -" - [1]=> - string(3) "|1|" - [2]=> - string(1) " -" - [3]=> - string(3) "|2|" - [4]=> - string(1) " -" - [5]=> - string(0) "" -} - ---> Pattern: '[[:print:]]{3}'; match: ' a ' - -Deprecated: Function spliti() is deprecated in %s on line %d -array(7) { - [0]=> - string(0) "" - [1]=> - string(0) "" - [2]=> - string(0) "" - [3]=> - string(0) "" - [4]=> - string(0) "" - [5]=> - string(0) "" - [6]=> - string(1) " " -} -Done diff --git a/ext/ereg/tests/spliti_basic_003.phpt b/ext/ereg/tests/spliti_basic_003.phpt deleted file mode 100644 index 39bd1dcbf7..0000000000 --- a/ext/ereg/tests/spliti_basic_003.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -Test spliti() function : basic functionality - a few non-matches ---FILE-- -<?php -/* Prototype : proto array spliti(string pattern, string string [, int limit]) - * Description: spliti string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -$replacement = 'r'; - -var_dump(spliti('[A-Z]', '-- 0 --')); -var_dump(spliti('(a){4}', '--- aaa ---')); -var_dump(spliti('^a', '--- ba ---')); -var_dump(spliti('b$', '--- ba ---')); -var_dump(spliti('[:alpha:]', '--- x ---')); - - -echo "Done"; -?> ---EXPECTF-- -Deprecated: Function spliti() is deprecated in %s on line %d -array(1) { - [0]=> - string(7) "-- 0 --" -} - -Deprecated: Function spliti() is deprecated in %s on line %d -array(1) { - [0]=> - string(11) "--- aaa ---" -} - -Deprecated: Function spliti() is deprecated in %s on line %d -array(1) { - [0]=> - string(10) "--- ba ---" -} - -Deprecated: Function spliti() is deprecated in %s on line %d -array(1) { - [0]=> - string(10) "--- ba ---" -} - -Deprecated: Function spliti() is deprecated in %s on line %d -array(1) { - [0]=> - string(9) "--- x ---" -} -Done diff --git a/ext/ereg/tests/spliti_basic_004.phpt b/ext/ereg/tests/spliti_basic_004.phpt deleted file mode 100644 index ed07193194..0000000000 --- a/ext/ereg/tests/spliti_basic_004.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -Test spliti() function : basic functionality - confirm case insensitivity ---FILE-- -<?php -/* Prototype : proto array spliti(string pattern, string string [, int limit]) - * Description: spliti string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -$replacement = 'r'; - -var_dump(spliti('[a-z]', '--- A ---')); -var_dump(spliti('[A-Z]', '--- a ---')); -var_dump(spliti('[[:lower:]]', '--- A ---')); -var_dump(spliti('[[:upper:]]', '--- a ---')); - -echo "Done"; -?> ---EXPECTF-- -Deprecated: Function spliti() is deprecated in %s on line %d -array(2) { - [0]=> - string(4) "--- " - [1]=> - string(4) " ---" -} - -Deprecated: Function spliti() is deprecated in %s on line %d -array(2) { - [0]=> - string(4) "--- " - [1]=> - string(4) " ---" -} - -Deprecated: Function spliti() is deprecated in %s on line %d -array(2) { - [0]=> - string(4) "--- " - [1]=> - string(4) " ---" -} - -Deprecated: Function spliti() is deprecated in %s on line %d -array(2) { - [0]=> - string(4) "--- " - [1]=> - string(4) " ---" -} -Done diff --git a/ext/ereg/tests/spliti_error_001.phpt b/ext/ereg/tests/spliti_error_001.phpt deleted file mode 100644 index cd4e6a99e6..0000000000 --- a/ext/ereg/tests/spliti_error_001.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test spliti() function : error conditions - wrong number of args ---FILE-- -<?php -/* Prototype : proto array spliti(string pattern, string string [, int limit]) - * Description: spliti string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -echo "*** Testing spliti() : error conditions - wrong number of args ***\n"; - - -//Test spliti with one more than the expected number of arguments -echo "\n-- Testing spliti() function with more than expected no. of arguments --\n"; -$pattern = 'string_val'; -$string = 'string_val'; -$limit = 10; -$extra_arg = 10; -var_dump( spliti($pattern, $string, $limit, $extra_arg) ); - -// Testing spliti with one less than the expected number of arguments -echo "\n-- Testing spliti() function with less than expected no. of arguments --\n"; -$pattern = 'string_val'; -var_dump( spliti($pattern) ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing spliti() : error conditions - wrong number of args *** - --- Testing spliti() function with more than expected no. of arguments -- - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti() expects at most 3 parameters, 4 given in %s on line %d -NULL - --- Testing spliti() function with less than expected no. of arguments -- - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti() expects at least 2 parameters, 1 given in %s on line %d -NULL -Done diff --git a/ext/ereg/tests/spliti_error_002.phpt b/ext/ereg/tests/spliti_error_002.phpt deleted file mode 100644 index 19dd171655..0000000000 --- a/ext/ereg/tests/spliti_error_002.phpt +++ /dev/null @@ -1,118 +0,0 @@ ---TEST-- -Test spliti() function : error conditions - test bad regular expressions ---FILE-- -<?php -/* Prototype : proto array spliti(string pattern, string string [, int limit]) - * Description: spliti string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -/* - * Test bad regular expressions - */ - -echo "*** Testing spliti() : error conditions ***\n"; - -$regs = 'original'; - -var_dump(spliti("", "hello")); -var_dump(spliti("c(d", "hello")); -var_dump(spliti("a[b", "hello")); -var_dump(spliti("c(d", "hello")); -var_dump(spliti("*", "hello")); -var_dump(spliti("+", "hello")); -var_dump(spliti("?", "hello")); -var_dump(spliti("(+?*)", "hello", $regs)); -var_dump(spliti("h{256}", "hello")); -var_dump(spliti("h|", "hello")); -var_dump(spliti("h{0}", "hello")); -var_dump(spliti("h{2,1}", "hello")); -var_dump(spliti('[a-c-e]', 'd')); -var_dump(spliti('\\', 'x')); -var_dump(spliti('([9-0])', '1', $regs)); - -//ensure $regs unchanged -var_dump($regs); - -echo "Done"; -?> ---EXPECTF-- -*** Testing spliti() : error conditions *** - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti(): REG_EPAREN in %s on line %d -bool(false) - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti(): REG_EBRACK in %s on line %d -bool(false) - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti(): REG_EPAREN in %s on line %d -bool(false) - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti(): REG_BADRPT in %s on line %d -bool(false) - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti() expects parameter 3 to be long, string given in %s on line %d -NULL - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti(): REG_BADBR in %s on line %d -bool(false) - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti(): REG_EMPTY in %s on line %d -bool(false) - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti(): REG_BADBR in %s on line %d -bool(false) - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti(): REG_ERANGE in %s on line %d -bool(false) - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti(): REG_EESCAPE in %s on line %d -bool(false) - -Deprecated: Function spliti() is deprecated in %s on line %d - -Warning: spliti() expects parameter 3 to be long, string given in %s on line %d -NULL -string(8) "original" -Done diff --git a/ext/ereg/tests/spliti_variation_001.phpt b/ext/ereg/tests/spliti_variation_001.phpt deleted file mode 100644 index e5493b34ad..0000000000 --- a/ext/ereg/tests/spliti_variation_001.phpt +++ /dev/null @@ -1,257 +0,0 @@ ---TEST-- -Test spliti() function : usage variations - unexpected type for arg 1 ---FILE-- -<?php -/* Prototype : proto array spliti(string pattern, string string [, int limit]) - * Description: spliti string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); - -echo "*** Testing spliti() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$string = '1 a 1 Array 1 c '; -$limit = 5; - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for pattern - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( spliti($value, $string, $limit) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing spliti() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(64) -Error: 8 - Undefined variable: unset_var, %s(67) - -Arg value 0 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(16) "1 a 1 Array 1 c " -} - -Arg value 1 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(4) { - [0]=> - string(0) "" - [1]=> - string(3) " a " - [2]=> - string(7) " Array " - [3]=> - string(3) " c " -} - -Arg value 12345 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(16) "1 a 1 Array 1 c " -} - -Arg value -2345 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(16) "1 a 1 Array 1 c " -} - -Arg value 10.5 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(16) "1 a 1 Array 1 c " -} - -Arg value -10.5 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(16) "1 a 1 Array 1 c " -} - -Arg value 101234567000 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(16) "1 a 1 Array 1 c " -} - -Arg value 1.07654321E-9 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(16) "1 a 1 Array 1 c " -} - -Arg value 0.5 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(16) "1 a 1 Array 1 c " -} -Error: 8 - Array to string conversion, %sspliti_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti() expects parameter 1 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %sspliti_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti() expects parameter 1 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %sspliti_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti() expects parameter 1 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %sspliti_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti() expects parameter 1 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %sspliti_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti(): REG_EMPTY, %s(74) -bool(false) - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti(): REG_EMPTY, %s(74) -bool(false) - -Arg value 1 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(4) { - [0]=> - string(0) "" - [1]=> - string(3) " a " - [2]=> - string(7) " Array " - [3]=> - string(3) " c " -} - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti(): REG_EMPTY, %s(74) -bool(false) - -Arg value 1 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(4) { - [0]=> - string(0) "" - [1]=> - string(3) " a " - [2]=> - string(7) " Array " - [3]=> - string(3) " c " -} - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti(): REG_EMPTY, %s(74) -bool(false) - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti(): REG_EMPTY, %s(74) -bool(false) - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti(): REG_EMPTY, %s(74) -bool(false) -Error: 4096 - Object of class stdClass could not be converted to string, %s(73) - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti() expects parameter 1 to be string, object given, %s(74) -NULL - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti(): REG_EMPTY, %s(74) -bool(false) - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti(): REG_EMPTY, %s(74) -bool(false) -Done diff --git a/ext/ereg/tests/spliti_variation_002.phpt b/ext/ereg/tests/spliti_variation_002.phpt deleted file mode 100644 index 752cafc4f5..0000000000 --- a/ext/ereg/tests/spliti_variation_002.phpt +++ /dev/null @@ -1,257 +0,0 @@ ---TEST-- -Test spliti() function : usage variations - unexpected type for arg 2 ---FILE-- -<?php -/* Prototype : proto array spliti(string pattern, string string [, int limit]) - * Description: spliti string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); - -echo "*** Testing spliti() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$pattern = 'r|j|E'; -$limit = 5; - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for string - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( spliti($pattern, $value, $limit) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing spliti() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(64) -Error: 8 - Undefined variable: unset_var, %s(67) - -Arg value 0 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(1) "0" -} - -Arg value 1 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(1) "1" -} - -Arg value 12345 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(5) "12345" -} - -Arg value -2345 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(5) "-2345" -} - -Arg value 10.5 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(4) "10.5" -} - -Arg value -10.5 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(5) "-10.5" -} - -Arg value 101234567000 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(12) "101234567000" -} - -Arg value 1.07654321E-9 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(2) { - [0]=> - string(10) "1.07654321" - [1]=> - string(2) "-9" -} - -Arg value 0.5 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(3) "0.5" -} -Error: 8 - Array to string conversion, %sspliti_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti() expects parameter 2 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %sspliti_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti() expects parameter 2 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %sspliti_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti() expects parameter 2 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %sspliti_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti() expects parameter 2 to be string, array given, %s(74) -NULL -Error: 8 - Array to string conversion, %sspliti_variation_002.php(%d) - -Arg value Array -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti() expects parameter 2 to be string, array given, %s(74) -NULL - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(0) "" -} - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(0) "" -} - -Arg value 1 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(1) "1" -} - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(0) "" -} - -Arg value 1 -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(1) "1" -} - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(0) "" -} - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(0) "" -} - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(0) "" -} -Error: 4096 - Object of class stdClass could not be converted to string, %s(73) - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -Error: 2 - spliti() expects parameter 2 to be string, object given, %s(74) -NULL - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(0) "" -} - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(74) -array(1) { - [0]=> - string(0) "" -} -Done diff --git a/ext/ereg/tests/spliti_variation_003.phpt b/ext/ereg/tests/spliti_variation_003.phpt deleted file mode 100644 index 3cfeaeae1a..0000000000 --- a/ext/ereg/tests/spliti_variation_003.phpt +++ /dev/null @@ -1,231 +0,0 @@ ---TEST-- -Test spliti() function : usage variations - unexpected type for arg 3 ---FILE-- -<?php -/* Prototype : proto array spliti(string pattern, string string [, int limit]) - * Description: spliti string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - if (error_reporting() != 0) { - // report non-silenced errors - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; - } -} -set_error_handler('test_error_handler'); -echo "*** Testing spliti() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) -$pattern = b'[[:space:]]'; -$string = '1 2 3 4 5'; - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // float data - 10.5, - -10.5, - 10.7654321E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => '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( spliti($pattern, $string, $value) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing spliti() : usage variations *** - -Arg value 10.5 -Error: 8192 - Function spliti() 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 spliti() is deprecated, %s(73) -array(1) { - [0]=> - string(9) "1 2 3 4 5" -} - -Arg value 1.07654321E-9 -Error: 8192 - Function spliti() is deprecated, %s(73) -array(1) { - [0]=> - string(9) "1 2 3 4 5" -} - -Arg value 0.5 -Error: 8192 - Function spliti() is deprecated, %s(73) -array(1) { - [0]=> - string(9) "1 2 3 4 5" -} -Error: 8 - Array to string conversion, %sspliti_variation_003.php(%d) - -Arg value Array -Error: 8192 - Function spliti() is deprecated, %s(73) -Error: 2 - spliti() expects parameter 3 to be long, array given, %s(73) -NULL -Error: 8 - Array to string conversion, %sspliti_variation_003.php(%d) - -Arg value Array -Error: 8192 - Function spliti() is deprecated, %s(73) -Error: 2 - spliti() expects parameter 3 to be long, array given, %s(73) -NULL -Error: 8 - Array to string conversion, %sspliti_variation_003.php(%d) - -Arg value Array -Error: 8192 - Function spliti() is deprecated, %s(73) -Error: 2 - spliti() expects parameter 3 to be long, array given, %s(73) -NULL -Error: 8 - Array to string conversion, %sspliti_variation_003.php(%d) - -Arg value Array -Error: 8192 - Function spliti() is deprecated, %s(73) -Error: 2 - spliti() expects parameter 3 to be long, array given, %s(73) -NULL -Error: 8 - Array to string conversion, %sspliti_variation_003.php(%d) - -Arg value Array -Error: 8192 - Function spliti() is deprecated, %s(73) -Error: 2 - spliti() expects parameter 3 to be long, array given, %s(73) -NULL - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(73) -array(1) { - [0]=> - string(9) "1 2 3 4 5" -} - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(73) -array(1) { - [0]=> - string(9) "1 2 3 4 5" -} - -Arg value 1 -Error: 8192 - Function spliti() is deprecated, %s(73) -array(1) { - [0]=> - string(9) "1 2 3 4 5" -} - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(73) -array(1) { - [0]=> - string(9) "1 2 3 4 5" -} - -Arg value 1 -Error: 8192 - Function spliti() is deprecated, %s(73) -array(1) { - [0]=> - string(9) "1 2 3 4 5" -} - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(73) -array(1) { - [0]=> - string(9) "1 2 3 4 5" -} - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(73) -Error: 2 - spliti() expects parameter 3 to be long, string given, %s(73) -NULL - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(73) -Error: 2 - spliti() expects parameter 3 to be long, string given, %s(73) -NULL - -Arg value string -Error: 8192 - Function spliti() is deprecated, %s(73) -Error: 2 - spliti() expects parameter 3 to be long, string given, %s(73) -NULL - -Arg value string -Error: 8192 - Function spliti() is deprecated, %s(73) -Error: 2 - spliti() 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 spliti() is deprecated, %s(73) -Error: 2 - spliti() expects parameter 3 to be long, object given, %s(73) -NULL - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(73) -array(1) { - [0]=> - string(9) "1 2 3 4 5" -} - -Arg value -Error: 8192 - Function spliti() is deprecated, %s(73) -array(1) { - [0]=> - string(9) "1 2 3 4 5" -} -Done
\ No newline at end of file diff --git a/ext/ereg/tests/spliti_variation_004.phpt b/ext/ereg/tests/spliti_variation_004.phpt deleted file mode 100644 index d9afa13892..0000000000 --- a/ext/ereg/tests/spliti_variation_004.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Test spliti() function : usage variations - out-of-range values for limit ---FILE-- -<?php -/* Prototype : proto array spliti(string pattern, string string [, int limit]) - * Description: spliti string into array by regular expression - * Source code: ext/standard/reg.c - * Alias to functions: - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); -echo "*** Testing spliti() : usage variations ***\n"; - -$pattern = '[[:space:]]'; -$string = '1 2 3 4 5'; -var_dump(spliti($pattern, $string, 0)); -var_dump(spliti($pattern, $string, -10)); - - -echo "Done"; -?> ---EXPECTF-- -*** Testing spliti() : usage variations *** -Error: 8192 - Function spliti() is deprecated, %s(16) -array(1) { - [0]=> - string(9) "1 2 3 4 5" -} -Error: 8192 - Function spliti() is deprecated, %s(17) -array(1) { - [0]=> - string(9) "1 2 3 4 5" -} -Done diff --git a/ext/ereg/tests/sql_regcase_basic_001.phpt b/ext/ereg/tests/sql_regcase_basic_001.phpt deleted file mode 100644 index 5a04724b75..0000000000 --- a/ext/ereg/tests/sql_regcase_basic_001.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test sql_regcase() function : basic functionality ---FILE-- -<?php -/* Prototype : proto string sql_regcase(string string) - * Description: Make regular expression for case insensitive match - * Source code: ext/standard/reg.c - * Alias to functions: msql_regcase - */ - -echo "*** Testing sql_regcase() : basic functionality ***\n"; - - -// Initialise all required variables -$string = 'string_Val-0'; - -// Calling sql_regcase() with all possible arguments -var_dump( sql_regcase($string) ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing sql_regcase() : basic functionality *** - -Deprecated: Function sql_regcase() is deprecated in %s on line %d -string(39) "[Ss][Tt][Rr][Ii][Nn][Gg]_[Vv][Aa][Ll]-0" -Done diff --git a/ext/ereg/tests/sql_regcase_error_001.phpt b/ext/ereg/tests/sql_regcase_error_001.phpt deleted file mode 100644 index 6ac71f27c1..0000000000 --- a/ext/ereg/tests/sql_regcase_error_001.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test sql_regcase() function : error conditions ---FILE-- -<?php -/* Prototype : proto string sql_regcase(string string) - * Description: Make regular expression for case insensitive match - * Source code: ext/standard/reg.c - * Alias to functions: msql_regcase - */ - -echo "*** Testing sql_regcase() : error conditions ***\n"; - -// Zero arguments -echo "\n-- Testing sql_regcase() function with Zero arguments --\n"; -var_dump( sql_regcase() ); - -//Test sql_regcase with one more than the expected number of arguments -echo "\n-- Testing sql_regcase() function with more than expected no. of arguments --\n"; -$string = 'string_val'; -$extra_arg = 10; -var_dump( sql_regcase($string, $extra_arg) ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing sql_regcase() : error conditions *** - --- Testing sql_regcase() function with Zero arguments -- - -Deprecated: Function sql_regcase() is deprecated in %s on line %d - -Warning: sql_regcase() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing sql_regcase() function with more than expected no. of arguments -- - -Deprecated: Function sql_regcase() is deprecated in %s on line %d - -Warning: sql_regcase() expects exactly 1 parameter, 2 given in %s on line %d -NULL -Done diff --git a/ext/ereg/tests/sql_regcase_variation_001.phpt b/ext/ereg/tests/sql_regcase_variation_001.phpt deleted file mode 100644 index 0efbe92622..0000000000 --- a/ext/ereg/tests/sql_regcase_variation_001.phpt +++ /dev/null @@ -1,196 +0,0 @@ ---TEST-- -Test sql_regcase() function : usage variations - unexpected arg type ---FILE-- -<?php -/* Prototype : proto string sql_regcase(string string) - * Description: Make regular expression for case insensitive match - * Source code: ext/standard/reg.c - * Alias to functions: msql_regcase - */ - -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; -} -set_error_handler('test_error_handler'); - -echo "*** Testing sql_regcase() : usage variations ***\n"; - -// Initialise function arguments not being substituted (if any) - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for string - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( sql_regcase($value) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing sql_regcase() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(62) -Error: 8 - Undefined variable: unset_var, %s(65) - -Arg value 0 -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(1) "0" - -Arg value 1 -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(1) "1" - -Arg value 12345 -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(5) "12345" - -Arg value -2345 -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(5) "-2345" - -Arg value 10.5 -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(4) "10.5" - -Arg value -10.5 -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(5) "-10.5" - -Arg value 101234567000 -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(12) "101234567000" - -Arg value 1.07654321E-9 -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(16) "1.07654321[Ee]-9" - -Arg value 0.5 -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(3) "0.5" -Error: 8 - Array to string conversion, %ssql_regcase_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s(72) -NULL -Error: 8 - Array to string conversion, %ssql_regcase_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s(72) -NULL -Error: 8 - Array to string conversion, %ssql_regcase_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s(72) -NULL -Error: 8 - Array to string conversion, %ssql_regcase_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s(72) -NULL -Error: 8 - Array to string conversion, %ssql_regcase_variation_001.php(%d) - -Arg value Array -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s(72) -NULL - -Arg value -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(0) "" - -Arg value -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(0) "" - -Arg value 1 -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(1) "1" - -Arg value -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(0) "" - -Arg value 1 -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(1) "1" - -Arg value -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(0) "" - -Arg value -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(0) "" - -Arg value -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(0) "" -Error: 4096 - Object of class stdClass could not be converted to string, %s(71) - -Arg value -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -Error: 2 - sql_regcase() expects parameter 1 to be string, object given, %s(72) -NULL - -Arg value -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(0) "" - -Arg value -Error: 8192 - Function sql_regcase() is deprecated, %s(72) -string(0) "" -Done |