1--TEST--
2Test strrchr() function : usage variations - heredoc string containing blank line for 'haystack'
3--FILE--
4<?php
5/* Prototype  : string strrchr(string $haystack, string $needle);
6 * Description: Finds the last occurrence of a character in a string.
7 * Source code: ext/standard/string.c
8*/
9
10/* Test strrchr() function by passing heredoc string containing
11 *  blank-line for haystack and with various needles
12*/
13
14echo "*** Testing strrchr() function: with heredoc strings ***\n";
15$blank_line = <<<EOD
16
17EOD;
18
19$needles = array(
20  "\n",
21  '\n',
22  "\r",
23  "\r\n",
24  "\t",
25  "",
26  $blank_line //needle as haystack
27);
28
29//loop through to test strrchr() with each needle
30foreach($needles as $needle) {
31  var_dump( strrchr($blank_line, $needle) );
32}
33echo "*** Done ***";
34?>
35--EXPECTF--
36*** Testing strrchr() function: with heredoc strings ***
37bool(false)
38bool(false)
39bool(false)
40bool(false)
41bool(false)
42bool(false)
43bool(false)
44*** Done ***
45