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)
37
38Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
39bool(false)
40
41Deprecated: strrchr(): Non-string needles will be interpreted as strings in %s on line %d
42bool(false)
43bool(false)
44bool(false)
45*** Done ***
46