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