1--TEST--
2Test stripos() function : error conditions
3--FILE--
4<?php
5echo "*** Testing stripos() function: error conditions ***\n";
6
7echo "\n-- Offset beyond the end of the string --\n";
8try {
9    stripos("Hello World", "o", 12);
10} catch (ValueError $exception) {
11    echo $exception->getMessage() . "\n";
12}
13
14echo "\n-- Offset before the start of the string --\n";
15try {
16    stripos("Hello World", "o", -12);
17} catch (ValueError $exception) {
18    echo $exception->getMessage() . "\n";
19}
20
21echo "*** Done ***";
22?>
23--EXPECT--
24*** Testing stripos() function: error conditions ***
25
26-- Offset beyond the end of the string --
27stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
28
29-- Offset before the start of the string --
30stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
31*** Done ***
32