1--TEST--
2Test strrpos() function : usage variations - empty heredoc string for 'haystack' argument
3--FILE--
4<?php
5/* Test strrpos() function by passing empty heredoc string for haystack
6 *  and with various needles & offsets
7*/
8
9echo "*** Testing strrpos() function: with heredoc strings ***\n";
10echo "-- With empty heredoc string --\n";
11$empty_string = <<<EOD
12EOD;
13var_dump( strrpos($empty_string, "") );
14try {
15    strrpos($empty_string, "", 1);
16} catch (ValueError $exception) {
17    echo $exception->getMessage() . "\n";
18}
19var_dump( strrpos($empty_string, FALSE) );
20var_dump( strrpos($empty_string, NULL) );
21
22echo "*** Done ***";
23?>
24--EXPECT--
25*** Testing strrpos() function: with heredoc strings ***
26-- With empty heredoc string --
27int(0)
28strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
29int(0)
30int(0)
31*** Done ***
32