xref: /PHP-8.3/ext/pcre/tests/bug77193.phpt (revision 74859783)
1--TEST--
2Bug #77193 Infinite loop in preg_replace_callback
3--EXTENSIONS--
4filter
5--FILE--
6<?php
7$text = '{CCM:CID_2}';
8echo '1';
9$mt = array();
10preg_replace_callback(
11    '/([0-9]+)/i',
12    function ($matches) {
13        echo $matches[1];
14        filter_var('http', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => '/^http$/i']]);
15    },
16    $text
17);
18echo '3', "\n";
19?>
20--EXPECT--
21123
22