1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 07:28:09 +02:00
Files
archived-php-src/ext/standard/tests/strings/strripos_offset.phpt
T
2019-12-20 16:43:40 +01:00

45 lines
892 B
PHP

--TEST--
strripos() offset integer overflow
--FILE--
<?php
try {
var_dump(strripos("t", "t", PHP_INT_MAX+1));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
try {
strripos(1024, 1024, -PHP_INT_MAX);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
}
try {
strripos(1024, "te", -PHP_INT_MAX);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
}
try {
strripos(1024, 1024, -PHP_INT_MAX-1);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
}
try {
strripos(1024, "te", -PHP_INT_MAX-1);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
}
echo "Done\n";
?>
--EXPECT--
strripos() expects parameter 3 to be int, float given
Offset not contained in string
Offset not contained in string
Offset not contained in string
Offset not contained in string
Done