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