3v4l.org

run code in 300+ PHP versions simultaneously
<?php $allowed = array('txt', 'docx'); $zzfile = "TEST" $filename = $zzfile; print "\nfilename:\n"; var_dump($filename); if (preg_match('#\.(.+)$#', $filename, $matches) && isset($matches[1]) && !in_array($matches[1], $allowed)) die("Extension ${matches[1]} is not allowed!"); echo "\nmatches:"; var_dump($matches); if (strrpos($filename, '.') !== false) //zwraca od pierwszej kropki od prawej do konca + end $ext = substr($filename, strrpos($filename, '.')); else $ext = ''; $newfile = "flag$ext"; print $newfile; echo "Reading <strong>$newfile</strong>..."; // Hint: the flag is in flag.php echo '<pre>'; readfile($newfile); echo '</pre>'; ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.0.80.0270.06022.02
7.0.20.0230.05720.23
7.0.10.0130.08320.13
7.0.00.0070.04720.07
5.6.160.0100.08320.44
5.6.150.0130.07318.25
5.6.140.0000.04718.24
5.6.130.0100.03318.17
5.6.120.0070.09020.98
5.6.110.0130.08020.98
5.6.100.0100.08021.11
5.6.90.0000.05320.87
5.6.80.0200.06720.37
5.5.300.0030.07718.08
5.5.290.0070.08318.03
5.5.280.0200.07020.84
5.5.270.0030.05720.74
5.5.260.0170.07020.86
5.5.250.0100.05320.68
5.5.240.0300.07320.03

preferences:
141.45 ms | 1394 KiB | 7 Q