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) );
20
21echo "*** Done ***";
22?>
23--EXPECT--
24*** Testing strrpos() function: with heredoc strings ***
25-- With empty heredoc string --
26int(0)
27strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
28int(0)
29*** Done ***
30