1--TEST--
2Test stripos() function : usage variations - heredoc string containing special 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 special chars for haystack
11 *  and with various needles & offets
12*/
13
14echo "*** Testing stripos() function: with heredoc strings ***\n";
15echo "-- With heredoc string containing special chars --\n";
16$special_chars_str = <<<EOD
17Ex'ple of h'doc st'g, contains
18$#%^*&*_("_")!#@@!$#$^^&$*(special)
19chars.
20EOD;
21var_dump( stripos($special_chars_str, "Ex'ple", 0) );
22var_dump( stripos($special_chars_str, "!@@!", 23) );
23var_dump( stripos($special_chars_str, '_') );
24var_dump( stripos($special_chars_str, '("_")') );
25var_dump( stripos($special_chars_str, "$*") );
26var_dump( stripos($special_chars_str, "$*", 10) );
27var_dump( stripos($special_chars_str, "(special)") );
28
29echo "*** Done ***";
30?>
31--EXPECTF--
32*** Testing stripos() function: with heredoc strings ***
33-- With heredoc string containing special chars --
34int(0)
35bool(false)
36int(38)
37int(39)
38int(55)
39int(55)
40int(57)
41*** Done ***
42