Annotation of embedaddon/php/ext/standard/tests/strings/stripos_variation5.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test stripos() function : usage variations - heredoc string containing escape chars for 'haystack' argument
3: --FILE--
4: <?php
5: /* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
6: * Description: Find position of first occurrence of a case-insensitive string
7: * Source code: ext/standard/string.c
8: */
9:
10: /* Test stripos() function by passing heredoc string containing escape chars for haystack
11: * and with various needles & offsets
12: */
13:
14: echo "*** Testing stripos() function: with heredoc strings ***\n";
15: echo "-- With heredoc string containing escape characters --\n";
16: $control_char_str = <<<EOD
17: Hello, World\n
18: Hello\tWorld
19: EOD;
20: var_dump( stripos($control_char_str, "\n") );
21: var_dump( stripos($control_char_str, "\t") );
22: var_dump( stripos($control_char_str, "\n", 12) );
23: var_dump( stripos($control_char_str, "\t", 15) );
24:
25: echo "*** Done ***";
26: ?>
27: --EXPECTF--
28: *** Testing stripos() function: with heredoc strings ***
29: -- With heredoc string containing escape characters --
30: int(12)
31: int(19)
32: int(12)
33: int(19)
34: *** Done ***
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>