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

1.1       misho       1: --TEST--
                      2: Test strrchr() function : usage variations - empty heredoc string for 'haystack'
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : string strrchr(string $haystack, string $needle);
                      6:  * Description: Finds the last occurrence of a character in a string.
                      7:  * Source code: ext/standard/string.c
                      8: */
                      9: 
                     10: /* Test strrchr() function by passing empty heredoc string for haystack
                     11:  *  and with various needles
                     12: */
                     13: 
                     14: echo "*** Testing strrchr() function: with heredoc strings ***\n";
                     15: $empty_str = <<<EOD
                     16: EOD;
                     17: 
                     18: $needles = array(
                     19:   "",
                     20:   '',
                     21:   FALSE,
                     22:   NULL,
                     23:   "\0",
                     24:   $empty_str //needle as haystack
                     25: );
                     26: 
                     27: //loop through to test strrchr() with each needle
                     28: foreach($needles as $needle) {
                     29:   var_dump( strrchr($empty_str, $needle) );
                     30: }
                     31: echo "*** Done ***";
                     32: ?>
                     33: --EXPECTF--
                     34: *** Testing strrchr() function: with heredoc strings ***
                     35: bool(false)
                     36: bool(false)
                     37: bool(false)
                     38: bool(false)
                     39: bool(false)
                     40: bool(false)
                     41: *** Done ***

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