Annotation of embedaddon/php/ext/ereg/tests/ereg_replace_basic_002.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test ereg_replace() function : basic functionality - a few non-matches
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:
11: $replacement = 'r';
12:
13: var_dump(ereg_replace('A', $replacement, 'a'));
14: var_dump(ereg_replace('[A-Z]', $replacement, '0'));
15: var_dump(ereg_replace('(a){4}', $replacement, 'aaa'));
16: var_dump(ereg_replace('^a', $replacement, 'ba'));
17: var_dump(ereg_replace('b$', $replacement, 'ba'));
18: var_dump(ereg_replace('[:alpha:]', $replacement, 'x'));
19:
20:
21: echo "Done";
22: ?>
23: --EXPECTF--
24: Deprecated: Function ereg_replace() is deprecated in %s on line %d
25: string(1) "a"
26:
27: Deprecated: Function ereg_replace() is deprecated in %s on line %d
28: string(1) "0"
29:
30: Deprecated: Function ereg_replace() is deprecated in %s on line %d
31: string(3) "aaa"
32:
33: Deprecated: Function ereg_replace() is deprecated in %s on line %d
34: string(2) "ba"
35:
36: Deprecated: Function ereg_replace() is deprecated in %s on line %d
37: string(2) "ba"
38:
39: Deprecated: Function ereg_replace() is deprecated in %s on line %d
40: string(1) "x"
41: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>