Annotation of embedaddon/php/ext/standard/tests/strings/strrpos_variation3.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test strrpos() function : usage variations - multi line heredoc string 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 multi-line heredoc string for haystack and
11: * with various needles & offsets
12: */
13:
14: echo "*** Testing strrpos() function: with heredoc strings ***\n";
15: echo "-- With heredoc string containing multi lines --\n";
16: $multi_line_str = <<<EOD
17: Example of string
18: spanning multiple lines
19: using heredoc syntax.
20: EOD;
21: var_dump( strrpos($multi_line_str, "ing", 0) );
22: var_dump( strrpos($multi_line_str, "ing", 15) );
23: var_dump( strrpos($multi_line_str, "ing", 22) );
24: var_dump( strrpos($multi_line_str, "") );
25: var_dump( strrpos($multi_line_str, " ") );
26:
27: echo "*** Done ***";
28: ?>
29: --EXPECTF--
30: *** Testing strrpos() function: with heredoc strings ***
31: -- With heredoc string containing multi lines --
32: int(44)
33: int(44)
34: int(44)
35: bool(false)
36: int(55)
37: *** Done ***
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>