Annotation of embedaddon/php/ext/standard/tests/strings/strrpos_variation7.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test strrpos() function : usage variations - empty 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 empty heredoc string for haystack
11: * and with various needles & offsets
12: */
13:
14: echo "*** Testing strrpos() function: with heredoc strings ***\n";
15: echo "-- With empty heredoc string --\n";
16: $empty_string = <<<EOD
17: EOD;
18: var_dump( strrpos($empty_string, "") );
19: var_dump( strrpos($empty_string, "", 1) );
20: var_dump( strrpos($empty_string, FALSE) );
21: var_dump( strrpos($empty_string, NULL) );
22:
23: echo "*** Done ***";
24: ?>
25: --EXPECTF--
26: *** Testing strrpos() function: with heredoc strings ***
27: -- With empty heredoc string --
28: bool(false)
29: bool(false)
30: bool(false)
31: bool(false)
32: *** Done ***
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>