1--TEST--
2Test strripos() function : basic functionality - with all arguments
3--FILE--
4<?php
5echo "*** Testing strripos() function: basic functionality ***\n";
6$heredoc_str = <<<EOD
7Hello, World
8EOD;
9
10echo "\n-- regular string for haystack & needle, with various offsets --\n";
11var_dump( strripos("Hello, World", "HeLLo", 0) );
12var_dump( strripos("Hello, World", 'Hello', 1) );
13var_dump( strripos('Hello, World', 'world', 1) );
14var_dump( strripos('Hello, World', "WorLD", 5) );
15
16echo "\n-- heredoc string for haystack & needle, with various offsets --\n";
17var_dump( strripos($heredoc_str, "Hello, WORLD", 0) );
18var_dump( strripos($heredoc_str, 'HelLo', 0) );
19var_dump( strripos($heredoc_str, 'HeLLo', 1) );
20var_dump( strripos($heredoc_str, $heredoc_str, 0) );
21var_dump( strripos($heredoc_str, $heredoc_str, 1) );
22
23echo "\n-- various +ve offsets --\n";
24var_dump( strripos("Hello, World", "O", 3) );
25var_dump( strripos("Hello, World", "O", 6) );
26var_dump( strripos("Hello, World", "O", 10) );
27
28echo "\n-- various -ve offsets --\n";
29var_dump( strripos("Hello, World", "O", -1) );
30var_dump( strripos("Hello, World", "O", -5) );
31var_dump( strripos("Hello, World", "O",  -9) );
32?>
33--EXPECT--
34*** Testing strripos() function: basic functionality ***
35
36-- regular string for haystack & needle, with various offsets --
37int(0)
38bool(false)
39int(7)
40int(7)
41
42-- heredoc string for haystack & needle, with various offsets --
43int(0)
44int(0)
45bool(false)
46int(0)
47bool(false)
48
49-- various +ve offsets --
50int(8)
51int(8)
52bool(false)
53
54-- various -ve offsets --
55int(8)
56int(4)
57bool(false)
58