3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (substr(PHP_VERSION, 0, 5) !== '7.1.6') die('Meh'); $s["HTTP_HOST"] = "localhost"; $s["HTTP_CONNECTION"] = "keep-alive"; $s["HTTP_USER_AGENT"] = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11"; $s["HTTP_ACCEPT"] = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; $s["HTTP_REFERER"] = "http://localhost/php/super-variables/;\$s.php"; $s["HTTP_ACCEPT_ENCODING"] = "gzip,deflate,sdch"; $s["HTTP_ACCEPT_LANGUAGE"] = "en-US,en;q=0.8"; $s["HTTP_ACCEPT_CHARSET"] = "ISO-8859-1,utf-8;q=0.7,*;q=0.3"; $s["HTTP_COOKIE"] = "bsau=13422601771944046296; bsas=13422601771975238542"; $s["PATH"] = "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; c:\python32\python;"; $s["SystemRoot"] = "C:\Windows"; $s["COMSPEC"] = "C:\Windows\system32\cmd.exe"; $s["PATHEXT"] = ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"; $s["WINDIR"] = "C:\Windows"; $s["SERVER_SIGNATURE"] = ""; $s["SERVER_SOFTWARE"] = "Apache/2.2.11 (Win32) PHP/5.3.0"; $s["SERVER_NAME"] = "localhost"; $s["SERVER_ADDR"] = "127.0.0.1"; $s["SERVER_PORT"] = "80"; $s["REMOTE_ADDR"] = "127.0.0.1"; $s["DOCUMENT_ROOT"] = "F:/wamp/www/"; $s["SERVER_ADMIN"] = "admin@localhost"; $s["SCRIPT_FILENAME"] = "F:/wamp/www/php/super-variables/test-;\$s.php"; $s["REMOTE_PORT"] = "51124"; $s["GATEWAY_INTERFACE"] = "CGI/1.1"; $s["SERVER_PROTOCOL"] = "HTTP/1.1"; $s["REQUEST_METHOD"] = "GET"; $s["QUERY_STRING"] = ""; $s["REQUEST_URI"] = "/php/super-variables/test-;\$s.php"; $s["SCRIPT_NAME"] = "/php/super-variables/test-;\$s.php"; $s["PHP_SELF"] = "/php/super-variables/test-;\$s.php"; $s["REQUEST_TIME"] = 1342260551; $a = microtime(1); for ($i = 20000; $i--;) { foreach ($s as $key => $val) { if ($key[0] === 'H' && substr($key, 0, 5) === 'HTTP_') { $key = substr($key, 5); } } } echo 1000 * (microtime(1) - $a) . "\n"; $a = microtime(1); for ($i = 20000; $i--;) { foreach ($s as $key => $val) { if (substr($key, 0, 5) === 'HTTP_') { $key = substr($key, 5); } } } echo 1000 * (microtime(1) - $a) . "\n";

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.3.10.0090.00316.67
7.3.00.0000.01016.61
7.2.130.0030.00716.98
7.2.120.0090.00316.64
7.2.110.0070.00716.71
7.2.100.0060.00316.42
7.2.90.0000.01016.81
7.2.80.0040.00716.88
7.2.70.0000.01316.77
7.2.60.0070.00716.70
7.2.50.0060.00616.66
7.2.40.0000.01416.67
7.2.30.0060.00616.91
7.2.20.0060.00916.82
7.2.10.0070.00416.55
7.2.00.0020.01218.03
7.1.250.0090.00015.49
7.1.70.0000.00717.13
7.1.60.0980.20833.34
7.1.50.0770.01333.11
7.1.40.0870.01732.75
7.1.30.1200.00732.56
7.1.20.0900.01332.83
7.1.10.0630.01314.82
7.1.00.0830.00714.57
7.0.200.0800.01014.70
7.0.190.0630.01014.78
7.0.180.0630.00314.61
7.0.170.1030.00714.29
7.0.160.1530.01314.41
7.0.150.0630.01314.36
7.0.140.0670.01314.60
7.0.130.0800.00714.64
7.0.120.0630.00714.89
7.0.110.0600.00714.61
7.0.100.0970.01014.38
7.0.90.0900.01014.40
7.0.80.0570.01314.43
7.0.70.0630.01314.55
7.0.60.0570.00714.42
7.0.50.1600.01314.52
7.0.40.0670.00314.80
7.0.30.0770.01714.60
7.0.20.0630.01014.52
7.0.10.0530.01314.84
7.0.00.0670.00314.84

preferences:
37.67 ms | 401 KiB | 5 Q