Annotation of embedaddon/php/ext/ereg/tests/ereg_replace_error_002.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test 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:
! 11: echo "*** Testing ereg_replace() : bad REs ***\n";
! 12: var_dump(ereg_replace("", "hello", "some string"));
! 13: var_dump(ereg_replace("c(d", "hello", "some string"));
! 14: var_dump(ereg_replace("a[b", "hello", "some string"));
! 15: var_dump(ereg_replace("c(d", "hello", "some string"));;
! 16: var_dump(ereg_replace("*", "hello", "some string"));
! 17: var_dump(ereg_replace("+", "hello", "some string"));
! 18: var_dump(ereg_replace("?", "hello", "some string"));
! 19: var_dump(ereg_replace("(+?*)", "hello", "some string"));
! 20: var_dump(ereg_replace("h{256}", "hello", "some string"));
! 21: var_dump(ereg_replace("h|", "hello", "some string"));
! 22: var_dump(ereg_replace("h{0}", "hello", "some string"));
! 23: var_dump(ereg_replace("h{2,1}", "hello", "some string"));
! 24: var_dump(ereg_replace('[a-c-e]', 'd', "some string"));
! 25: var_dump(ereg_replace('\\', 'x', "some string"));
! 26: var_dump(ereg_replace('([9-0])', '1', "some string"));
! 27: echo "Done";
! 28: ?>
! 29: --EXPECTF--
! 30: *** Testing ereg_replace() : bad REs ***
! 31:
! 32: Deprecated: Function ereg_replace() is deprecated in %s on line %d
! 33:
! 34: Warning: ereg_replace(): REG_EMPTY in %s on line %d
! 35: bool(false)
! 36:
! 37: Deprecated: Function ereg_replace() is deprecated in %s on line %d
! 38:
! 39: Warning: ereg_replace(): REG_EPAREN in %s on line %d
! 40: bool(false)
! 41:
! 42: Deprecated: Function ereg_replace() is deprecated in %s on line %d
! 43:
! 44: Warning: ereg_replace(): REG_EBRACK in %s on line %d
! 45: bool(false)
! 46:
! 47: Deprecated: Function ereg_replace() is deprecated in %s on line %d
! 48:
! 49: Warning: ereg_replace(): REG_EPAREN in %s on line %d
! 50: bool(false)
! 51:
! 52: Deprecated: Function ereg_replace() is deprecated in %s on line %d
! 53:
! 54: Warning: ereg_replace(): REG_BADRPT in %s on line %d
! 55: bool(false)
! 56:
! 57: Deprecated: Function ereg_replace() is deprecated in %s on line %d
! 58:
! 59: Warning: ereg_replace(): REG_BADRPT in %s on line %d
! 60: bool(false)
! 61:
! 62: Deprecated: Function ereg_replace() is deprecated in %s on line %d
! 63:
! 64: Warning: ereg_replace(): REG_BADRPT in %s on line %d
! 65: bool(false)
! 66:
! 67: Deprecated: Function ereg_replace() is deprecated in %s on line %d
! 68:
! 69: Warning: ereg_replace(): REG_BADRPT in %s on line %d
! 70: bool(false)
! 71:
! 72: Deprecated: Function ereg_replace() is deprecated in %s on line %d
! 73:
! 74: Warning: ereg_replace(): REG_BADBR in %s on line %d
! 75: bool(false)
! 76:
! 77: Deprecated: Function ereg_replace() is deprecated in %s on line %d
! 78:
! 79: Warning: ereg_replace(): REG_EMPTY in %s on line %d
! 80: bool(false)
! 81:
! 82: Deprecated: Function ereg_replace() is deprecated in %s on line %d
! 83:
! 84: Warning: ereg_replace(): REG_EMPTY in %s on line %d
! 85: bool(false)
! 86:
! 87: Deprecated: Function ereg_replace() is deprecated in %s on line %d
! 88:
! 89: Warning: ereg_replace(): REG_BADBR in %s on line %d
! 90: bool(false)
! 91:
! 92: Deprecated: Function ereg_replace() is deprecated in %s on line %d
! 93:
! 94: Warning: ereg_replace(): REG_ERANGE in %s on line %d
! 95: bool(false)
! 96:
! 97: Deprecated: Function ereg_replace() is deprecated in %s on line %d
! 98:
! 99: Warning: ereg_replace(): REG_EESCAPE in %s on line %d
! 100: bool(false)
! 101:
! 102: Deprecated: Function ereg_replace() is deprecated in %s on line %d
! 103:
! 104: Warning: ereg_replace(): REG_ERANGE in %s on line %d
! 105: bool(false)
! 106: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>