diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/ereg/tests/split_error_002.phpt | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/ereg/tests/split_error_002.phpt')
-rw-r--r-- | ext/ereg/tests/split_error_002.phpt | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/ext/ereg/tests/split_error_002.phpt b/ext/ereg/tests/split_error_002.phpt new file mode 100644 index 0000000..9eaac59 --- /dev/null +++ b/ext/ereg/tests/split_error_002.phpt @@ -0,0 +1,118 @@ +--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 |