Annotation of embedaddon/php/ext/standard/tests/strings/strrpos_variation6.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test 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:
14: echo "*** Testing strrpos() function: with heredoc strings ***\n";
15: echo "-- With heredoc string containing quote & slash chars --\n";
16: $quote_char_str = <<<EOD
17: it's bright,but i cann't see it.
18: "things in double quote"
19: 'things in single quote'
20: this\line is /with\slashs
21: EOD;
22: var_dump( strrpos($quote_char_str, "line") );
23: var_dump( strrpos($quote_char_str, 'things') );
24: var_dump( strrpos($quote_char_str, 'things', 0) );
25: var_dump( strrpos($quote_char_str, "things", 20) );
26: echo "*** Done ***";
27: ?>
28: --EXPECTF--
29: *** Testing strrpos() function: with heredoc strings ***
30: -- With heredoc string containing quote & slash chars --
31: int(88)
32: int(59)
33: int(59)
34: int(59)
35: *** Done ***
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>