1--TEST--
2Offset errors for various strpos functions
3--FILE--
4<?php
5
6try {
7    var_dump(mb_strpos("f", "bar", 3));
8} catch (\ValueError $e) {
9    echo $e->getMessage() . \PHP_EOL;
10}
11try {
12    var_dump(mb_strpos("f", "bar", -3));
13} catch (\ValueError $e) {
14    echo $e->getMessage() . \PHP_EOL;
15}
16try {
17    var_dump(mb_strrpos("f", "bar", 3));
18} catch (\ValueError $e) {
19    echo $e->getMessage() . \PHP_EOL;
20}
21try {
22    var_dump(mb_strrpos("f", "bar", -3));
23} catch (\ValueError $e) {
24    echo $e->getMessage() . \PHP_EOL;
25}
26try {
27    var_dump(mb_stripos("f", "bar", 3));
28} catch (\ValueError $e) {
29    echo $e->getMessage() . \PHP_EOL;
30}
31try {
32    var_dump(mb_stripos("f", "bar", -3));
33} catch (\ValueError $e) {
34    echo $e->getMessage() . \PHP_EOL;
35}
36try {
37    var_dump(mb_strripos("f", "bar", 3));
38} catch (\ValueError $e) {
39    echo $e->getMessage() . \PHP_EOL;
40}
41try {
42    var_dump(mb_strripos("f", "bar", -3));
43} catch (\ValueError $e) {
44    echo $e->getMessage() . \PHP_EOL;
45}
46
47?>
48--EXPECT--
49mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
50mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
51mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
52mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
53mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
54mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
55mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
56mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
57