1--TEST--
2strripos() offset integer overflow
3--FILE--
4<?php
5
6try {
7    var_dump(strripos("t", "t", PHP_INT_MAX+1));
8} catch (TypeError $e) {
9    echo $e->getMessage(), "\n";
10}
11
12try {
13    strripos(1024, 1024, -PHP_INT_MAX);
14} catch (ValueError $exception) {
15    echo $exception->getMessage() . "\n";
16}
17
18try {
19    strripos(1024, "te", -PHP_INT_MAX);
20} catch (ValueError $exception) {
21    echo $exception->getMessage() . "\n";
22}
23
24try {
25    strripos(1024, 1024, -PHP_INT_MAX-1);
26} catch (ValueError $exception) {
27    echo $exception->getMessage() . "\n";
28}
29
30try {
31    strripos(1024, "te", -PHP_INT_MAX-1);
32} catch (ValueError $exception) {
33    echo $exception->getMessage() . "\n";
34}
35
36echo "Done\n";
37?>
38--EXPECT--
39strripos(): Argument #3 ($offset) must be of type int, float given
40strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
41strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
42strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
43strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
44Done
45