@ 2017-06-13T09:13:28Z <?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";
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
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).
Version System time (s) User time (s) Memory (MiB) 7.3.1 0.009 0.003 16.67 7.3.0 0.000 0.010 16.61 7.2.13 0.003 0.007 16.98 7.2.12 0.009 0.003 16.64 7.2.11 0.007 0.007 16.71 7.2.10 0.006 0.003 16.42 7.2.9 0.000 0.010 16.81 7.2.8 0.004 0.007 16.88 7.2.7 0.000 0.013 16.77 7.2.6 0.007 0.007 16.70 7.2.5 0.006 0.006 16.66 7.2.4 0.000 0.014 16.67 7.2.3 0.006 0.006 16.91 7.2.2 0.006 0.009 16.82 7.2.1 0.007 0.004 16.55 7.2.0 0.002 0.012 18.03 7.1.25 0.009 0.000 15.49 7.1.7 0.000 0.007 17.13 7.1.6 0.098 0.208 33.34 7.1.5 0.077 0.013 33.11 7.1.4 0.087 0.017 32.75 7.1.3 0.120 0.007 32.56 7.1.2 0.090 0.013 32.83 7.1.1 0.063 0.013 14.82 7.1.0 0.083 0.007 14.57 7.0.20 0.080 0.010 14.70 7.0.19 0.063 0.010 14.78 7.0.18 0.063 0.003 14.61 7.0.17 0.103 0.007 14.29 7.0.16 0.153 0.013 14.41 7.0.15 0.063 0.013 14.36 7.0.14 0.067 0.013 14.60 7.0.13 0.080 0.007 14.64 7.0.12 0.063 0.007 14.89 7.0.11 0.060 0.007 14.61 7.0.10 0.097 0.010 14.38 7.0.9 0.090 0.010 14.40 7.0.8 0.057 0.013 14.43 7.0.7 0.063 0.013 14.55 7.0.6 0.057 0.007 14.42 7.0.5 0.160 0.013 14.52 7.0.4 0.067 0.003 14.80 7.0.3 0.077 0.017 14.60 7.0.2 0.063 0.010 14.52 7.0.1 0.053 0.013 14.84 7.0.0 0.067 0.003 14.84
preferences:dark mode live preview
37.67 ms | 401 KiB | 5 Q