1--TEST-- 2preg_replace() with array of failing regular expressions 3--INI-- 4pcre.jit=0 5pcre.backtrack_limit=100000 6--FILE-- 7<?php 8 9$text = '[CODE]<td align="$stylevar[right]">[/CODE]'; 10$result = preg_replace(array('#\[(right)\](((?R)|[^[]+?|\[)*)\[/\\1\]#siU', '#\[(right)\](((?R)|[^[]+?|\[)*)\[/\\1\]#siU'), '', $text); 11var_dump($text); 12var_dump($result); 13 14$result = preg_replace('#\[(right)\](((?R)|[^[]+?|\[)*)\[/\\1\]#siU', '', $text); 15var_dump($text); 16var_dump($result); 17 18echo "Done\n"; 19?> 20--EXPECTF-- 21string(58) "[CODE]<td align="$stylevar[right]">[/CODE]" 22NULL 23string(58) "[CODE]<td align="$stylevar[right]">[/CODE]" 24NULL 25Done 26