1--TEST--
2Test strripos() function : usage variations - heredoc string containing special chars for 'haystack' argument
3--FILE--
4<?php
5/* Prototype  : int strripos ( string $haystack, string $needle [, int $offset] );
6 * Description: Find position of last occurrence of a case-insensitive 'needle' in a 'haystack'
7 * Source code: ext/standard/string.c
8*/
9
10/* Test strripos() function by passing heredoc string containing special chars for haystack
11 *  and with various needles & offets
12*/
13
14echo "*** Testing strripos() 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( strripos($special_chars_str, "Ex'pLE", 0) );
22var_dump( strripos($special_chars_str, "!@@!", 23) );
23var_dump( strripos($special_chars_str, '_') );
24var_dump( strripos($special_chars_str, '("_")') );
25var_dump( strripos($special_chars_str, "$*") );
26var_dump( strripos($special_chars_str, "$*", 10) );
27var_dump( strripos($special_chars_str, "(speCIal)") );
28
29?>
30===DONE===
31--EXPECTF--
32*** Testing strripos() function: with heredoc strings ***
33-- With heredoc string containing special chars --
34int(0)
35bool(false)
36int(41)
37int(39)
38int(55)
39int(55)
40int(57)
41===DONE===
42