3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex = '(((?!a).)*)*a\\{'; $test_string = 'AAAAAAAAAAAAAA{AA'; echo "1:".mb_ereg_replace($regex,'WORKED',$test_string)."\n"; $test_string = 'AAAAAAAAAAAAAA{AA'; echo "2:".preg_replace('/(*UCP)'.$regex.'/u','WORKED',$test_string)."\n"; $test_string = 'AAAAAAAAAAAAAA{AA'; echo "3:".preg_replace('/'.$regex.'/','WORKED',$test_string)."\n";

preferences:
38.06 ms | 402 KiB | 5 Q