1--TEST--
2Test stripos() function : usage variations - empty heredoc string 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 empty heredoc string for haystack
11 *  and with various needles & offsets
12*/
13
14echo "*** Testing stripos() function: with heredoc strings ***\n";
15echo "-- With empty heredoc string --\n";
16$empty_string = <<<EOD
17EOD;
18var_dump( stripos($empty_string, "") );
19var_dump( stripos($empty_string, "", 1) );
20var_dump( stripos($empty_string, FALSE) );
21var_dump( stripos($empty_string, NULL) );
22
23echo "*** Done ***";
24?>
25--EXPECTF--
26*** Testing stripos() function: with heredoc strings ***
27-- With empty heredoc string --
28bool(false)
29
30Warning: stripos(): Offset not contained in string in %s on line %d
31bool(false)
32bool(false)
33bool(false)
34*** Done ***
35