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