summaryrefslogtreecommitdiff
path: root/ext/pcre/tests/bug77193.phpt
blob: 4fdb603b8591aa335ee666d558c33129df989239 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--TEST--
Bug #77193 Infinite loop in preg_replace_callback
--SKIPIF--
<?php
	if (!extension_loaded("filter")) {
		die("skip need filter extension");
	}
?>
--FILE--
<?php
$text = '{CCM:CID_2}';
echo '1';
$mt = array();
preg_replace_callback(
    '/([0-9]+)/i',
    function ($matches) {
        echo $matches[1];
        filter_var('http', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => '/^http$/i']]);
    },
    $text
);
echo '3', "\n";
?>
--EXPECT--
123