- str_repeat: documentation ( source)
- preg_match: documentation ( source)
<?php
$max_n=100010;
$n=99900;
$tmp_str=str_repeat('b',$n);
$go=true;
while (($go)&&($n<=$max_n)) {
$n++;
$tmp_str.='b';
$str='a'.$tmp_str.'a';
$go=preg_match('/a.*?a/sim', $str);
if (!$go) {
echo 'error on length '.strlen($str);
die;
}
}
echo ' ok';