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