Annotation of embedaddon/php/ext/standard/tests/strings/strripos_offset.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: strripos() offset integer overflow
                      3: --FILE--
                      4: <?php
                      5: 
                      6: var_dump(strripos("t", "t", PHP_INT_MAX+1));
                      7: var_dump(strripos("tttt", "tt", PHP_INT_MAX+1));
                      8: var_dump(strripos(100, 101, PHP_INT_MAX+1));
                      9: var_dump(strripos(1024, 1024, PHP_INT_MAX+1));
                     10: var_dump(strripos(array(), array(), PHP_INT_MAX+1));
                     11: var_dump(strripos(1024, 1024, -PHP_INT_MAX));
                     12: var_dump(strripos(1024, "te", -PHP_INT_MAX));
                     13: var_dump(strripos(1024, 1024, -PHP_INT_MAX-1));
                     14: var_dump(strripos(1024, "te", -PHP_INT_MAX-1));
                     15: 
                     16: echo "Done\n";
                     17: ?>
                     18: --EXPECTF--    
                     19: Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
                     20: bool(false)
                     21: 
                     22: Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
                     23: bool(false)
                     24: 
                     25: Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
                     26: bool(false)
                     27: 
                     28: Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
                     29: bool(false)
                     30: 
                     31: Warning: strripos() expects parameter 1 to be string, array given in %s on line %d
                     32: bool(false)
                     33: 
                     34: Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
                     35: bool(false)
                     36: 
                     37: Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
                     38: bool(false)
                     39: 
                     40: Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
                     41: bool(false)
                     42: 
                     43: Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d
                     44: bool(false)
                     45: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>