1--TEST-- 2Compiled regex cache limit 3--FILE-- 4<?php 5define('PREG_CACHE_SIZE', 4096+1); 6 7$re = ''; 8$str = str_repeat('x', PREG_CACHE_SIZE); 9 10for ($i=0; $i < PREG_CACHE_SIZE; ++$i) { 11 $re .= '.'; 12 if (!preg_match("/$re/", $str)) { 13 die('non match. error'); 14 } 15} 16 17var_dump(preg_match('/./', $str)); // this one was already deleted from the cache 18var_dump(preg_match("/$re/", $str)); // but not this one 19 20echo "done\n"; 21?> 22--EXPECT-- 23int(1) 24int(1) 25done 26