Annotation of embedaddon/php/ext/pcre/tests/bug21732.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #21732 (preg_replace() segfaults with invalid parameters)
                      3: --INI--
                      4: error_reporting=0
                      5: --FILE--
                      6: <?php
                      7: class foo {
                      8:        function cb($param) {
                      9:                var_dump($param);
                     10:                return "yes!";
                     11:        }
                     12: }
                     13: 
                     14: var_dump(preg_replace('', array(), ''));
                     15: var_dump(preg_replace_callback("/(ab)(cd)(e)/", array(new foo(), "cb"), 'abcde'));
                     16: ?>
                     17: --EXPECT--
                     18: bool(false)
                     19: array(4) {
                     20:   [0]=>
                     21:   string(5) "abcde"
                     22:   [1]=>
                     23:   string(2) "ab"
                     24:   [2]=>
                     25:   string(2) "cd"
                     26:   [3]=>
                     27:   string(1) "e"
                     28: }
                     29: string(4) "yes!"

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