1--TEST--
2Test strrpos() function : usage variations - heredoc string containing quotes for 'haystack' argument
3--FILE--
4<?php
5/* Prototype  : int strrpos ( string $haystack, string $needle [, int $offset] );
6 * Description: Find position of last occurrence of 'needle' in 'haystack'.
7 * Source code: ext/standard/string.c
8*/
9
10/* Test strrpos() function by passing heredoc string containing quotes for haystack
11 *  and with various needles & offsets
12*/
13
14echo "*** Testing strrpos() function: with heredoc strings ***\n";
15echo "-- With heredoc string containing quote & slash chars --\n";
16$quote_char_str = <<<EOD
17it's bright,but i cann't see it.
18"things in double quote"
19'things in single quote'
20this\line is /with\slashs
21EOD;
22var_dump( strrpos($quote_char_str, "line") );
23var_dump( strrpos($quote_char_str, 'things') );
24var_dump( strrpos($quote_char_str, 'things', 0) );
25var_dump( strrpos($quote_char_str, "things", 20) );
26echo "*** Done ***";
27?>
28--EXPECTF--
29*** Testing strrpos() function: with heredoc strings ***
30-- With heredoc string containing quote & slash chars --
31int(88)
32int(59)
33int(59)
34int(59)
35*** Done ***
36