1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00
Files
archived-php-src/ext/standard/tests/strings/strripos_offset.phpt
T
Máté Kocsis 960318ed95 Change argument error message format
Closes GH-5211
2020-02-26 15:00:08 +01:00

45 lines
905 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(): Argument #3 ($offset) must be of type int, float given
Offset not contained in string
Offset not contained in string
Offset not contained in string
Offset not contained in string
Done