Annotation of embedaddon/php/ext/mbstring/tests/mb_strrchr_error2.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Test mb_strrchr() function : error conditions 
        !             3: --SKIPIF--
        !             4: <?php
        !             5: extension_loaded('mbstring') or die('skip');
        !             6: function_exists('mb_strrchr') or die("skip mb_strrchr() is not available in this build");
        !             7: ?>
        !             8: --FILE--
        !             9: <?php
        !            10: /* Prototype  : string mb_strrchr(string haystack, string needle[, bool part[, string encoding]])
        !            11:  * Description: Finds the last occurrence of a character in a string within another 
        !            12:  * Source code: ext/mbstring/mbstring.c
        !            13:  * Alias to functions: 
        !            14:  */
        !            15: 
        !            16: echo "*** Testing mb_strrchr() : error conditions ***\n";
        !            17: 
        !            18: 
        !            19: echo "\n-- Testing mb_strrchr() with unknown encoding --\n";
        !            20: $haystack = b'Hello, world';
        !            21: $needle = b'world';
        !            22: $encoding = 'unknown-encoding';
        !            23: $part = true;
        !            24: var_dump( mb_strrchr($haystack, $needle, $part, $encoding) );
        !            25: 
        !            26: ?>
        !            27: ===DONE===
        !            28: --EXPECTF--
        !            29: *** Testing mb_strrchr() : error conditions ***
        !            30: 
        !            31: -- Testing mb_strrchr() with unknown encoding --
        !            32: 
        !            33: Warning: mb_strrchr(): Unknown encoding "unknown-encoding" in %s on line %d
        !            34: bool(false)
        !            35: ===DONE===

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