$str = str_repeat('a', 1024 * 1024);
//$str = str_repeat('a', 1024);
$temp = preg_replace('#.*?^-+[^-]+-+[\r\n ]*$#ms', '', $str, 1);
echo strlen($temp);
With str_repeat('a', 1024)
the length of $temp
is 1024 but with str_repeat('a', 1024 * 1024)
the length of $temp
is 0.
I'm running PHP 7.4.3.
What could be the problem?