Annotation of embedaddon/php/ext/mbstring/tests/bug45923.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #45923 (mb_st[r]ripos() offset not handled correctly)
! 3: --SKIPIF--
! 4: <?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
! 5: --INI--
! 6: mbstring.internal_encoding=UTF-8
! 7: --FILE--
! 8: <?php
! 9: var_dump(strpos("abc abc abc", "abc", 0));
! 10: var_dump(strpos("abc abc abc", "abc", 3));
! 11: var_dump(strpos("abc abc abc", "abc", 6));
! 12: var_dump(strpos("abc abc abc", "abc", 9));
! 13: var_dump(strpos("abc abc abc", "abc", 11));
! 14: var_dump(strpos("abc abc abc", "abc", 12));
! 15: var_dump(strpos("abc abc abc", "abc", -1));
! 16: var_dump(strpos("abc abc abc", "abc", -3));
! 17: var_dump(strpos("abc abc abc", "abc", -6));
! 18:
! 19: var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", 0));
! 20: var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", 3));
! 21: var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", 6));
! 22: var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", 9));
! 23: var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", 11));
! 24: var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", 12));
! 25: var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", -1));
! 26: var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", -3));
! 27: var_dump(mb_strpos("●○◆ ●○◆ ●○◆", "●○◆", -6));
! 28:
! 29: var_dump(stripos("abc abc abc", "abc", 0));
! 30: var_dump(stripos("abc abc abc", "abc", 3));
! 31: var_dump(stripos("abc abc abc", "abc", 6));
! 32: var_dump(stripos("abc abc abc", "abc", 9));
! 33: var_dump(stripos("abc abc abc", "abc", 11));
! 34: var_dump(stripos("abc abc abc", "abc", 12));
! 35: var_dump(stripos("abc abc abc", "abc", -1));
! 36: var_dump(stripos("abc abc abc", "abc", -3));
! 37: var_dump(stripos("abc abc abc", "abc", -6));
! 38:
! 39: var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", 0));
! 40: var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", 3));
! 41: var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", 6));
! 42: var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", 9));
! 43: var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", 11));
! 44: var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", 12));
! 45: var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", -1));
! 46: var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", -3));
! 47: var_dump(mb_stripos("●○◆ ●○◆ ●○◆", "●○◆", -6));
! 48:
! 49: var_dump(strrpos("abc abc abc", "abc", 0));
! 50: var_dump(strrpos("abc abc abc", "abc", 3));
! 51: var_dump(strrpos("abc abc abc", "abc", 6));
! 52: var_dump(strrpos("abc abc abc", "abc", 9));
! 53: var_dump(strrpos("abc abc abc", "abc", 11));
! 54: var_dump(strrpos("abc abc abc", "abc", 12));
! 55: var_dump(strrpos("abc abc abc", "abc", -1));
! 56: var_dump(strrpos("abc abc abc", "abc", -3));
! 57: var_dump(strrpos("abc abc abc", "abc", -6));
! 58:
! 59: var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", 0));
! 60: var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", 3));
! 61: var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", 6));
! 62: var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", 9));
! 63: var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", 11));
! 64: var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", 12));
! 65: var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", -1));
! 66: var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", -3));
! 67: var_dump(mb_strrpos("●○◆ ●○◆ ●○◆", "●○◆", -6));
! 68:
! 69: var_dump(strripos("abc abc abc", "abc", 0));
! 70: var_dump(strripos("abc abc abc", "abc", 3));
! 71: var_dump(strripos("abc abc abc", "abc", 6));
! 72: var_dump(strripos("abc abc abc", "abc", 9));
! 73: var_dump(strripos("abc abc abc", "abc", 11));
! 74: var_dump(strripos("abc abc abc", "abc", 12));
! 75: var_dump(strripos("abc abc abc", "abc", -1));
! 76: var_dump(strripos("abc abc abc", "abc", -3));
! 77: var_dump(strripos("abc abc abc", "abc", -6));
! 78:
! 79: var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", 0));
! 80: var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", 3));
! 81: var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", 6));
! 82: var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", 9));
! 83: var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", 11));
! 84: var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", 12));
! 85: var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", -1));
! 86: var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", -3));
! 87: var_dump(mb_strripos("●○◆ ●○◆ ●○◆", "●○◆", -6));
! 88:
! 89: ?>
! 90: --EXPECTF--
! 91: int(0)
! 92: int(4)
! 93: int(8)
! 94: bool(false)
! 95: bool(false)
! 96:
! 97: Warning: strpos(): Offset not contained in string in %s on line %d
! 98: bool(false)
! 99:
! 100: Warning: strpos(): Offset not contained in string in %s on line %d
! 101: bool(false)
! 102:
! 103: Warning: strpos(): Offset not contained in string in %s on line %d
! 104: bool(false)
! 105:
! 106: Warning: strpos(): Offset not contained in string in %s on line %d
! 107: bool(false)
! 108: int(0)
! 109: int(4)
! 110: int(8)
! 111: bool(false)
! 112: bool(false)
! 113:
! 114: Warning: mb_strpos(): Offset not contained in string in %s on line %d
! 115: bool(false)
! 116:
! 117: Warning: mb_strpos(): Offset not contained in string in %s on line %d
! 118: bool(false)
! 119:
! 120: Warning: mb_strpos(): Offset not contained in string in %s on line %d
! 121: bool(false)
! 122:
! 123: Warning: mb_strpos(): Offset not contained in string in %s on line %d
! 124: bool(false)
! 125: int(0)
! 126: int(4)
! 127: int(8)
! 128: bool(false)
! 129: bool(false)
! 130:
! 131: Warning: stripos(): Offset not contained in string in %s on line %d
! 132: bool(false)
! 133:
! 134: Warning: stripos(): Offset not contained in string in %s on line %d
! 135: bool(false)
! 136:
! 137: Warning: stripos(): Offset not contained in string in %s on line %d
! 138: bool(false)
! 139:
! 140: Warning: stripos(): Offset not contained in string in %s on line %d
! 141: bool(false)
! 142: int(0)
! 143: int(4)
! 144: int(8)
! 145: bool(false)
! 146: bool(false)
! 147:
! 148: Warning: mb_stripos(): Offset not contained in string in %s on line %d
! 149: bool(false)
! 150:
! 151: Warning: mb_stripos(): Offset not contained in string in %s on line %d
! 152: bool(false)
! 153:
! 154: Warning: mb_stripos(): Offset not contained in string in %s on line %d
! 155: bool(false)
! 156:
! 157: Warning: mb_stripos(): Offset not contained in string in %s on line %d
! 158: bool(false)
! 159: int(8)
! 160: int(8)
! 161: int(8)
! 162: bool(false)
! 163: bool(false)
! 164:
! 165: Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
! 166: bool(false)
! 167: int(8)
! 168: int(8)
! 169: int(4)
! 170: int(8)
! 171: int(8)
! 172: int(8)
! 173: bool(false)
! 174: bool(false)
! 175:
! 176: Warning: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
! 177: bool(false)
! 178: int(8)
! 179: int(8)
! 180: int(4)
! 181: int(8)
! 182: int(8)
! 183: int(8)
! 184: bool(false)
! 185: bool(false)
! 186:
! 187: Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
! 188: bool(false)
! 189: int(8)
! 190: int(8)
! 191: int(4)
! 192: int(8)
! 193: int(8)
! 194: int(8)
! 195: bool(false)
! 196: bool(false)
! 197:
! 198: Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
! 199: bool(false)
! 200: int(8)
! 201: int(8)
! 202: int(4)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>