1--TEST--
2Test ereg_replace() function : error conditions - bad regular expressions
3--FILE--
4<?php
5/* Prototype  : proto string ereg_replace(string pattern, string replacement, string string)
6 * Description: Replace regular expression
7 * Source code: ext/standard/reg.c
8 * Alias to functions:
9 */
10
11echo "*** Testing ereg_replace() : bad REs ***\n";
12var_dump(ereg_replace("", "hello", "some string"));
13var_dump(ereg_replace("c(d", "hello", "some string"));
14var_dump(ereg_replace("a[b", "hello", "some string"));
15var_dump(ereg_replace("c(d", "hello", "some string"));;
16var_dump(ereg_replace("*", "hello", "some string"));
17var_dump(ereg_replace("+", "hello", "some string"));
18var_dump(ereg_replace("?", "hello", "some string"));
19var_dump(ereg_replace("(+?*)", "hello", "some string"));
20var_dump(ereg_replace("h{256}", "hello", "some string"));
21var_dump(ereg_replace("h|", "hello", "some string"));
22var_dump(ereg_replace("h{0}", "hello", "some string"));
23var_dump(ereg_replace("h{2,1}", "hello", "some string"));
24var_dump(ereg_replace('[a-c-e]', 'd', "some string"));
25var_dump(ereg_replace('\\', 'x', "some string"));
26var_dump(ereg_replace('([9-0])', '1', "some string"));
27echo "Done";
28?>
29--EXPECTF--
30*** Testing ereg_replace() : bad REs ***
31
32Deprecated: Function ereg_replace() is deprecated in %s on line %d
33
34Warning: ereg_replace(): REG_EMPTY in %s on line %d
35bool(false)
36
37Deprecated: Function ereg_replace() is deprecated in %s on line %d
38
39Warning: ereg_replace(): REG_EPAREN in %s on line %d
40bool(false)
41
42Deprecated: Function ereg_replace() is deprecated in %s on line %d
43
44Warning: ereg_replace(): REG_EBRACK in %s on line %d
45bool(false)
46
47Deprecated: Function ereg_replace() is deprecated in %s on line %d
48
49Warning: ereg_replace(): REG_EPAREN in %s on line %d
50bool(false)
51
52Deprecated: Function ereg_replace() is deprecated in %s on line %d
53
54Warning: ereg_replace(): REG_BADRPT in %s on line %d
55bool(false)
56
57Deprecated: Function ereg_replace() is deprecated in %s on line %d
58
59Warning: ereg_replace(): REG_BADRPT in %s on line %d
60bool(false)
61
62Deprecated: Function ereg_replace() is deprecated in %s on line %d
63
64Warning: ereg_replace(): REG_BADRPT in %s on line %d
65bool(false)
66
67Deprecated: Function ereg_replace() is deprecated in %s on line %d
68
69Warning: ereg_replace(): REG_BADRPT in %s on line %d
70bool(false)
71
72Deprecated: Function ereg_replace() is deprecated in %s on line %d
73
74Warning: ereg_replace(): REG_BADBR in %s on line %d
75bool(false)
76
77Deprecated: Function ereg_replace() is deprecated in %s on line %d
78
79Warning: ereg_replace(): REG_EMPTY in %s on line %d
80bool(false)
81
82Deprecated: Function ereg_replace() is deprecated in %s on line %d
83
84Warning: ereg_replace(): REG_EMPTY in %s on line %d
85bool(false)
86
87Deprecated: Function ereg_replace() is deprecated in %s on line %d
88
89Warning: ereg_replace(): REG_BADBR in %s on line %d
90bool(false)
91
92Deprecated: Function ereg_replace() is deprecated in %s on line %d
93
94Warning: ereg_replace(): REG_ERANGE in %s on line %d
95bool(false)
96
97Deprecated: Function ereg_replace() is deprecated in %s on line %d
98
99Warning: ereg_replace(): REG_EESCAPE in %s on line %d
100bool(false)
101
102Deprecated: Function ereg_replace() is deprecated in %s on line %d
103
104Warning: ereg_replace(): REG_ERANGE in %s on line %d
105bool(false)
106Done
107