3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* This version is not compatible with previous versions of the client */ define('vpsp_version', '2.5.0'); /* Set your password here Leave the variable empty to use no password ! Remove { and } */ define('vpsp_pwd', '{password}'); /* Set encryption key here Don't leave the variable empty. In order to enable/disable encryption use 'Enable traffic encryption' setting in the GUI client. ! Remove { and } */ define('vpsp_enc_key', '{key}'); /* Displaying of any messages is suppressed. In order to keep downloaded file integrity, no extraneous data must be ouptut by this script */ error_reporting(~E_ALL); @set_time_limit(0); ob_implicit_flush(1); ignore_user_abort(0); header('Content-type: application/octet-stream'); header('Content-Transfer-Encoding: binary'); header('X-VPSP-VERSION: ' . vpsp_version); $input = fopen('php://input', 'r'); define('vpsp_enc', ord(fread($input, 1)) != 0); $ok; if (vpsp_enc) { if (isset($GLOBALS['vpsp_pe']) == false) { $GLOBALS['vpsp_ks'] = VC_GenerateKeyHash(vpsp_enc_key); $GLOBALS['vpsp_pe'] = VC_Init(vpsp_enc_key, $GLOBALS['vpsp_ks']); } $GLOBALS['vpsp_pd'] = array_flip($GLOBALS['vpsp_pe']); $ok = VC_Decrypt(fread($input, 2)); if ($ok != 'OK') { header('X-VPSP-ERROR: bad_enc_key'); header('X-VPSP-HOST: ' . (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); exit; } $rBuffLen = ord(VC_Decrypt(fread($input, 1))) * 256 * 256 * 256 + ord(VC_Decrypt(fread($input, 1))) * 256 * 256 + ord(VC_Decrypt(fread($input, 1))) * 256 + ord(VC_Decrypt(fread($input, 1))); $sBuffLen = ord(VC_Decrypt(fread($input, 1))) * 256 * 256 * 256 + ord(VC_Decrypt(fread($input, 1))) * 256 * 256 + ord(VC_Decrypt(fread($input, 1))) * 256 + ord(VC_Decrypt(fread($input, 1))); $reqPwdLen = ord(VC_Decrypt(fread($input, 1))); $reqPwd = ($reqPwdLen > 0) ? VC_Decrypt(fread($input, $reqPwdLen)) : ''; $https = ord(VC_Decrypt(fread($input, 1))); $host = VC_Decrypt(fread($input, ord(VC_Decrypt(fread($input, 1))))); $port = ord(VC_Decrypt(fread($input, 1))) * 256 + ord(VC_Decrypt(fread($input, 1))); } else { $ok = fread($input, 2); if ($ok != 'OK') { header('X-VPSP-ERROR: bad_request'); header('X-VPSP-HOST: ' . (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); exit; } $rBuffLen = ord(fread($input, 1)) * 256 * 256 * 256 + ord(fread($input, 1)) * 256 * 256 + ord(fread($input, 1)) * 256 + ord(fread($input, 1)); $sBuffLen = ord(fread($input, 1)) * 256 * 256 * 256 + ord(fread($input, 1)) * 256 * 256 + ord(fread($input, 1)) * 256 + ord(fread($input, 1)); $reqPwdLen = ord(fread($input, 1)); $reqPwd = ($reqPwdLen > 0) ? fread($input, $reqPwdLen) : ''; $https = ord(fread($input, 1)); $host = fread($input, ord(fread($input, 1))); $port = ord(fread($input, 1)) * 256 + ord(fread($input, 1)); } if ($reqPwd !== vpsp_pwd) { $resp = "HTTP/1.0 401 Unauthorized\r\nX-VPSP-VERSION: " . vpsp_version . "\r\nX-VPSP-ERROR: bad_password\r\nX-VPSP-HOST: " . (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "\r\nConnection: close\r\n\r\n"; if (vpsp_enc) { echo VC_Encrypt($resp); } else { echo $resp; } exit; } if ($https == 1) { $host = 'ssl://' . $host; } $fsok = fsockopen($host, $port, $errno, $errstr, 20); if ($fsok == false) { $resp = "HTTP/1.0 503 Service Unavailable\r\nX-VPSP-VERSION: " . vpsp_version . "\r\nX-VPSP-ERROR: host_down\r\nX-VPSP-ERROR-TEXT: " . base64_encode($errstr) ."\r\nX-VPSP-HOST: " . (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "\r\nX-VPSP-TARGET: " . str_replace('ssl://', '', $host) . "\r\nConnection: close\r\n\r\n"; if (vpsp_enc) { echo VC_Encrypt($resp); } else { echo $resp; } exit; } while ($wbuffer = fread($input, $rBuffLen)) { if (vpsp_enc) { fwrite($fsok, VC_Decrypt($wbuffer)); } else { fwrite($fsok, $wbuffer); } } fflush($fsok); while ($rbuffer = fread($fsok, $sBuffLen)) { if (vpsp_enc) { echo VC_Encrypt($rbuffer); } else { echo $rbuffer; } } fflush($fsok); fclose($fsok); function MD5Hash($str) { $m = md5($str); $s = ''; foreach(explode("\n", trim(chunk_split($m, 2))) as $h) { $s .= chr(hexdec($h)); } return $s; } function VC_Init($key, $ks) { $s = range(0, 255); if (strlen($key) == 0) { return $s; } $km = MD5Hash($key); $kx = ''; for ($i = 0; $i < 16; $i++) { $kx .= MD5Hash($km . $km[$i] . chr($ks)); } $r = ($ks % 0x0F) + 1; $j = $ks; for ($n = 0; $n < $r; $n++) { for ($i = 0; $i < 256; $i++) { $j = (($j + $s[$i] + $n + ord($kx[$i])) ^ $ks) % 256; $t = $s[$i]; $s[$i] = $s[$j]; $s[$j] = $t; } } for ($i = 0; $i < 256; $i++) { $s[$i] = $s[$i] ^ $ks; } return $s; } function VC_GenerateKeyHash($key) { $m = MD5Hash($key); $kt = 0; for ($i = 0; $i < 16; $i++) { $kt += ord($m[$i]); } return $kt % 256; } function VC_Encrypt($str) { $pe = $GLOBALS['vpsp_pe']; $out = ''; $len = strlen($str); for ($y = 0; $y < $len; $y++) { $out .= chr($pe[ord($str[$y])]); } return $out; } function VC_Decrypt($str) { $pd = $GLOBALS['vpsp_pd']; $out = ''; $len = strlen($str); for ($y = 0; $y < $len; $y++) { $out .= chr($pd[ord($str[$y])]); } return $out; }

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)
8.3.60.0030.01418.32
8.3.50.0140.00521.99
8.3.40.0120.00318.96
8.3.30.0110.01118.99
8.3.20.0040.00420.32
8.3.10.0080.00023.66
8.3.00.0060.00319.26
8.2.180.0080.00818.66
8.2.170.0150.00622.96
8.2.160.0180.00420.47
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0160.00326.16
8.2.120.0040.00422.20
8.2.110.0040.00422.17
8.2.100.0040.00818.03
8.2.90.0000.00819.48
8.2.80.0050.00317.97
8.2.70.0070.00317.85
8.2.60.0000.00918.05
8.2.50.0070.00518.07
8.2.40.0030.00519.88
8.2.30.0000.00819.87
8.2.20.0030.00617.89
8.2.10.0040.00418.29
8.2.00.0040.00417.96
8.1.280.0040.01125.92
8.1.270.0050.00323.83
8.1.260.0040.00426.35
8.1.250.0020.00528.09
8.1.240.0060.00323.82
8.1.230.0080.00419.30
8.1.220.0000.00817.80
8.1.210.0050.00318.77
8.1.200.0060.00317.48
8.1.190.0080.00017.24
8.1.180.0000.00918.10
8.1.170.0030.00518.77
8.1.160.0030.00522.25
8.1.150.0050.00318.85
8.1.140.0000.00917.62
8.1.130.0050.00217.94
8.1.120.0000.00817.67
8.1.110.0000.00817.63
8.1.100.0000.00717.66
8.1.90.0000.00817.53
8.1.80.0050.00517.66
8.1.70.0040.00417.59
8.1.60.0000.00817.68
8.1.50.0050.00317.53
8.1.40.0030.00517.74
8.1.30.0080.00017.80
8.1.20.0050.00517.82
8.1.10.0050.00317.68
8.1.00.0050.00517.56
8.0.300.0000.00720.64
8.0.290.0000.00917.29
8.0.280.0030.00318.58
8.0.270.0000.00717.42
8.0.260.0030.00317.44
8.0.250.0070.00017.18
8.0.240.0040.00417.21
8.0.230.0030.00317.08
8.0.220.0000.00717.08
8.0.210.0000.00717.18
8.0.200.0030.00317.13
8.0.190.0080.00017.24
8.0.180.0050.00217.18
8.0.170.0000.01017.13
8.0.160.0070.00017.17
8.0.150.0000.00717.20
8.0.140.0060.00317.05
8.0.130.0000.00613.56
8.0.120.0000.00917.20
8.0.110.0040.00417.13
8.0.100.0080.00017.12
8.0.90.0070.00017.07
8.0.80.0080.00817.14
8.0.70.0040.00417.13
8.0.60.0040.00417.07
8.0.50.0000.00717.15
8.0.30.0120.00717.08
8.0.20.0080.01217.40
8.0.10.0030.00717.11
8.0.00.0120.00816.89
7.4.330.0030.00315.15
7.4.320.0030.00416.79
7.4.300.0040.00416.73
7.4.290.0000.00716.66
7.4.280.0050.00316.66
7.4.270.0050.00216.54
7.4.260.0000.00713.46
7.4.250.0040.00416.63
7.4.240.0070.00016.73
7.4.230.0000.00716.66
7.4.220.0110.00716.71
7.4.210.0080.00616.77
7.4.200.0040.00416.57
7.4.190.0030.00516.63
7.4.160.0170.00016.89
7.4.150.0110.01117.40
7.4.140.0070.01117.86
7.4.130.0090.01016.78
7.4.120.0100.01416.65
7.4.110.0070.01416.79
7.4.100.0060.01216.72
7.4.90.0120.00616.67
7.4.80.0190.00019.39
7.4.70.0070.01016.80
7.4.60.0040.01416.47
7.4.50.0030.00616.71
7.4.40.0090.01516.73
7.4.30.0000.01616.77
7.4.00.0000.01815.00
7.3.330.0000.00513.53
7.3.320.0030.00313.67
7.3.310.0080.00016.48
7.3.300.0040.00416.57
7.3.290.0040.01116.67
7.3.280.0090.01016.68
7.3.270.0040.01417.40
7.3.260.0190.00716.52
7.3.250.0100.00716.58
7.3.240.0110.00716.61
7.3.230.0090.00916.73
7.3.210.0090.00916.66
7.3.200.0180.00019.39
7.3.190.0150.00916.61
7.3.180.0110.00816.53
7.3.170.0060.01116.72
7.3.160.0090.00816.68
7.3.120.0120.00315.05
7.2.330.0070.01116.62
7.2.320.0100.00716.99
7.2.310.0090.00916.99
7.2.300.0120.01216.96
7.2.290.0070.01716.93
7.2.60.0030.01016.98
7.1.200.0060.00915.58
7.1.70.0000.00717.24
7.1.60.0130.01319.46
7.1.50.0100.01316.89
7.1.00.0030.07722.54
7.0.200.0070.00316.70
7.0.140.0000.08022.15
7.0.100.0100.07320.08
7.0.90.0130.03320.12
7.0.80.0030.09320.27
7.0.70.0100.07320.07
7.0.60.0100.08320.07
7.0.50.0130.07020.40
7.0.40.0100.08020.09
7.0.30.0030.08020.19
7.0.20.0000.09020.08
7.0.10.0030.08720.13
7.0.00.0070.09720.07
5.6.280.0000.07721.15
5.6.250.0030.08320.67
5.6.240.0100.07720.79
5.6.230.0100.08020.73
5.6.220.0100.08320.71
5.6.210.0030.09320.56
5.6.200.0100.06721.11
5.6.190.0100.04721.11
5.6.180.0170.07021.15
5.6.170.0100.08021.14
5.6.160.0030.08321.24
5.6.150.0030.09021.08
5.6.140.0170.07321.10
5.6.130.0070.09020.98
5.6.120.0100.08321.13
5.6.110.0100.04321.06
5.6.100.0170.07721.17
5.6.90.0130.07721.21
5.6.80.0000.05320.56
5.6.70.0100.07720.62
5.6.60.0030.07020.38
5.6.50.0070.08320.49
5.6.40.0100.07720.51
5.6.30.0270.05320.60
5.6.20.0170.07020.60
5.6.10.0100.05320.46
5.6.00.0170.06320.43
5.5.380.0100.07720.43
5.5.370.0070.08720.56
5.5.360.0100.04020.41
5.5.350.0030.06320.40
5.5.340.0100.06320.71
5.5.330.0170.07720.84
5.5.320.0130.08020.71
5.5.310.0070.04320.80
5.5.300.0100.07320.83
5.5.290.0030.08720.90
5.5.280.0030.08320.83
5.5.270.0100.08320.87
5.5.260.0130.07720.97
5.5.250.0130.07320.76
5.5.240.0070.07720.38
5.5.230.0170.05320.25
5.5.220.0070.07720.32
5.5.210.0130.06720.28
5.5.200.0170.07020.25
5.5.190.0100.05720.27
5.5.180.0130.07320.35
5.5.160.0170.07320.20
5.5.150.0170.06720.29
5.5.140.0170.07020.34
5.5.130.0100.07020.10
5.5.120.0100.06720.18
5.5.110.0070.07720.19
5.5.100.0130.07320.14
5.5.90.0070.08020.05
5.5.80.0100.07720.14
5.5.70.0200.06720.14
5.5.60.0130.07720.23
5.5.50.0130.07020.10
5.5.40.0100.07020.00
5.5.30.0100.06320.14
5.5.20.0070.04320.15
5.5.10.0100.04020.05
5.5.00.0100.04720.11
5.4.450.0100.08019.36
5.4.440.0070.08319.39
5.4.430.0170.07019.22
5.4.420.0130.07019.38
5.4.410.0030.08719.22
5.4.400.0030.08319.16
5.4.390.0070.08019.06
5.4.380.0100.07319.18
5.4.370.0200.06719.19
5.4.360.0070.05019.08
5.4.350.0100.07319.07
5.4.340.0070.07319.09
5.4.320.0130.07719.15
5.4.310.0130.06018.85
5.4.300.0030.08019.12
5.4.290.0070.07319.13
5.4.280.0170.06719.14
5.4.270.0100.05319.20
5.4.260.0070.07719.16
5.4.250.0170.07319.14
5.4.240.0130.06719.15
5.4.230.0100.07018.98
5.4.220.0170.07018.89
5.4.210.0170.07319.13
5.4.200.0130.07019.21
5.4.190.0130.06019.18
5.4.180.0070.07719.18
5.4.170.0070.07319.08
5.4.160.0100.07719.17
5.4.150.0070.07019.21
5.4.140.0070.07316.34
5.4.130.0070.04016.41
5.4.120.0130.07316.45
5.4.110.0030.06716.46
5.4.100.0070.07316.45
5.4.90.0030.07716.39
5.4.80.0070.07716.55
5.4.70.0030.07316.55
5.4.60.0030.07716.47
5.4.50.0070.07316.54
5.4.40.0070.07316.42
5.4.30.0100.07016.36
5.4.20.0070.07316.49
5.4.10.0070.07016.52
5.4.00.0070.07715.88
5.3.290.0130.07315.70
5.3.280.0070.07715.70
5.3.270.0100.07015.70
5.3.260.0030.08715.70
5.3.250.0130.03715.70
5.3.240.0130.07015.70
5.3.230.0070.07315.70
5.3.220.0100.07015.70
5.3.210.0070.07715.70
5.3.200.0170.06715.70
5.3.190.0070.07315.70
5.3.180.0070.06715.70
5.3.170.0030.07315.70
5.3.160.0130.07315.70
5.3.150.0100.07315.70
5.3.140.0070.07315.70
5.3.130.0030.07715.70
5.3.120.0100.07715.70
5.3.110.0130.03715.70
5.3.100.0070.07315.70
5.3.90.0030.07015.70
5.3.80.0130.07015.70
5.3.70.0070.07315.70
5.3.60.0130.06315.70
5.3.50.0030.05315.70
5.3.40.0070.05715.70
5.3.30.0070.06715.70
5.3.20.0030.07315.70
5.3.10.0070.06315.70
5.3.00.0030.03715.70

preferences:
47.26 ms | 400 KiB | 5 Q