1--TEST--
2Test strrchr() function : usage variations - multi line heredoc string 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 multi-line heredoc string for haystack and
11 *    with various needles
12*/
13
14echo "*** Testing strrchr() function: with heredoc strings ***\n";
15$multi_line_str = <<<EOD
16Example of string
17spanning multiple lines
18using heredoc syntax.
19EOD;
20
21$needles = array(
22  "ing",
23  "",
24  " ",
25  $multi_line_str //needle as haystack
26);
27
28//loop through to test strrchr() with each needle
29foreach($needles as $needle) {
30  var_dump( strrchr($multi_line_str, $needle) );
31}
32
33echo "*** Done ***";
34?>
35--EXPECTF--
36*** Testing strrchr() function: with heredoc strings ***
37string(19) "ing heredoc syntax."
38bool(false)
39string(8) " syntax."
40string(63) "Example of string
41spanning multiple lines
42using heredoc syntax."
43*** Done ***
44