Annotation of embedaddon/php/ext/standard/tests/strings/stripos_variation7.phpt, revision 1.1.1.1

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>