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