1--TEST--
2Test strrchr() function : usage variations - heredoc string containing quote chars for 'haystack'
3--FILE--
4<?php
5/* Test strrchr() function by passing heredoc string containing quote chars for haystack
6 *  and with various needles
7*/
8
9echo "*** Testing strrchr() function: with heredoc strings ***\n";
10$quote_char_str = <<<EOD
11"things" "in" "double" "quote"
12'things' 'in' 'single' 'quote'
13EOD;
14
15$needles = array(
16  "things",
17  "\"things\"",
18  "\'things\'",
19  "in",
20  "quote",
21  $quote_char_str //needle as haystack
22);
23
24//loop through to test strrchr() with each needle
25foreach($needles as $needle) {
26  var_dump( strrchr($quote_char_str, $needle) );
27}
28echo "*** Done ***";
29?>
30--EXPECT--
31*** Testing strrchr() function: with heredoc strings ***
32string(3) "te'"
33string(32) ""
34'things' 'in' 'single' 'quote'"
35bool(false)
36string(14) "ingle' 'quote'"
37string(6) "quote'"
38string(32) ""
39'things' 'in' 'single' 'quote'"
40*** Done ***
41