diff options
Diffstat (limited to 'ext/pcre/tests')
-rw-r--r-- | ext/pcre/tests/bug77193.phpt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/pcre/tests/bug77193.phpt b/ext/pcre/tests/bug77193.phpt new file mode 100644 index 0000000000..5dc7913db2 --- /dev/null +++ b/ext/pcre/tests/bug77193.phpt @@ -0,0 +1,27 @@ +--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"; +?> +===DONE=== +--EXPECT-- +123 +===DONE=== |