3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = str_repeat('a', 1024 * 1024); // $str = str_repeat('a', 1024); $temp = preg_replace('#.*?^-+[^-]+-+[\r\n ]*$#ms', '', $str, 1); if (preg_last_error() == PREG_BACKTRACK_LIMIT_ERROR) { echo "Backtrack limit was exhausted!\n\n"; } echo strlen($temp);
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Backtrack limit was exhausted! Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/02cQ8 on line 12 0
Output for 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
Backtrack limit was exhausted! 0

preferences:
78.11 ms | 1494 KiB | 4 Q