3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mirror = "the.site-you-want-to-mirror.com"; // Change this value to the site you want to mirror. $req = $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . " HTTP/1.0\r\n"; $length = 0; foreach ($_SERVER as $k => $v) { if (substr($k, 0, 5) == "HTTP_") { $k = str_replace('_', ' ', substr($k, 5)); $k = str_replace(' ', '-', ucwords(strtolower($k))); if ($k == "Host") $v = $mirror; # Alter "Host" header to mirrored server if ($k == "Accept-Encoding") $v = "identity;q=1.0, *;q=0"; # Alter "Accept-Encoding" header to accept unencoded content only if ($k == "Keep-Alive") continue; # Drop "Keep-Alive" header if ($k == "Connection" && $v == "keep-alive") $v = "close"; # Alter value of "Connection" header from "keep-alive" to "close" $req .= $k . ": " . $v . "\r\n"; } } $body = @file_get_contents('php://input'); $req .= "Content-Type: " . $_SERVER['CONTENT_TYPE'] . "\r\n"; $req .= "Content-Length: " . strlen($body) . "\r\n"; $req .= "\r\n"; $req .= $body; #print $req; $fp = fsockopen($mirror, 80, $errno, $errmsg, 30); if (!$fp) { print "HTTP/1.0 502 Failed to connect remote server\r\n"; print "Content-Type: text/html\r\n\r\n"; print "<html><body>Failed to connect to $mirror due to:<br>[$errno] $errstr</body></html>"; exit; } fwrite($fp, $req); $headers_processed = 0; $reponse = ''; while (!feof($fp)) { $r = fread($fp, 8192); if (!$headers_processed) { $response .= $r; $nlnl = strpos($response, "\r\n\r\n"); $add = 4; if (!$nlnl) { $nlnl = strpos($response, "\n\n"); $add = 2; } if (!$nlnl) continue; $headers = substr($response, 0, $nlnl); $cookies = 'Set-Cookie: '; if (preg_match_all('/^(.*?)(\r?\n|$)/ims', $headers, $matches)) for ($i = 0; $i < count($matches[0]); ++$i) { $ct = $matches[1][$i]; # if (substr($ct, 0, 12) == "Set-Cookie: ") { # $cookies .= substr($ct, 12) . ','; # header($cookies); # } else header($ct, false); # print '>>' . $ct . "\r\n"; } print substr($response, $nlnl + $add); $headers_processed = 1; } else print $r; } fclose ($fp); ?>

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.0060.01318.75
8.3.50.0120.00721.27
8.3.40.0090.00619.09
8.3.30.0090.00619.06
8.3.20.0050.00320.57
8.3.10.0060.00322.00
8.3.00.0080.00023.89
8.2.180.0130.00617.25
8.2.170.0110.00722.96
8.2.160.0070.00720.59
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0050.00320.08
8.2.120.0040.00426.35
8.2.110.0030.00919.44
8.2.100.0030.00917.97
8.2.90.0030.00618.13
8.2.80.0040.00419.16
8.2.70.0000.00918.00
8.2.60.0000.00817.75
8.2.50.0080.00017.88
8.2.40.0000.00818.00
8.2.30.0040.00419.71
8.2.20.0000.00717.98
8.2.10.0080.00018.46
8.2.00.0060.00318.30
8.1.280.0110.00425.92
8.1.270.0090.00023.95
8.1.260.0070.00328.09
8.1.250.0040.00428.09
8.1.240.0040.00722.17
8.1.230.0120.00021.01
8.1.220.0030.00518.88
8.1.210.0080.00018.77
8.1.200.0030.00617.60
8.1.190.0030.00517.38
8.1.180.0080.00022.32
8.1.170.0080.00017.62
8.1.160.0040.00420.87
8.1.150.0040.00419.02
8.1.140.0000.00819.70
8.1.130.0000.00717.84
8.1.120.0030.00517.63
8.1.110.0040.00417.74
8.1.100.0000.00817.65
8.1.90.0060.00317.58
8.1.80.0030.00517.58
8.1.70.0000.00717.62
8.1.60.0000.00817.75
8.1.50.0000.01017.70
8.1.40.0030.00517.67
8.1.30.0040.00417.80
8.1.20.0030.00617.95
8.1.10.0040.00417.75
8.1.00.0070.00017.57
8.0.300.0000.00820.22
8.0.290.0000.00817.25
8.0.280.0000.00718.64
8.0.270.0040.00418.93
8.0.260.0070.00017.41
8.0.250.0040.00417.24
8.0.240.0000.00817.21
8.0.230.0000.00717.21
8.0.220.0030.00617.18
8.0.210.0000.00817.20
8.0.200.0030.00317.15
8.0.190.0040.00417.28
8.0.180.0000.00717.20
8.0.170.0060.00317.26
8.0.160.0000.00817.15
8.0.150.0000.00717.18
8.0.140.0040.00417.16
8.0.130.0000.00613.71
8.0.120.0000.00917.34
8.0.110.0040.00417.40
8.0.100.0060.00317.23
8.0.90.0000.00817.23
8.0.80.0120.00417.20
8.0.70.0050.00317.19
8.0.60.0050.00317.29
8.0.50.0060.00317.18
8.0.30.0120.00917.46
8.0.20.0130.00917.46
8.0.10.0030.00517.34
8.0.00.0110.01017.03
7.4.330.0000.00617.09
7.4.320.0000.00716.76
7.4.300.0000.00716.72
7.4.290.0000.00816.73
7.4.280.0030.00616.77
7.4.270.0030.00316.88
7.4.260.0080.00016.65
7.4.250.0050.00316.84
7.4.240.0040.00416.87
7.4.230.0040.00416.83
7.4.220.0080.02016.92
7.4.210.0100.00816.80
7.4.200.0040.00416.94
7.4.160.0110.00716.62
7.4.150.0130.00617.40
7.4.140.0160.01017.86
7.4.130.0080.01016.82
7.4.120.0130.00916.86
7.4.110.0100.01016.87
7.4.100.0150.00316.88
7.4.90.0140.00716.77
7.4.80.0090.00919.39
7.4.70.0060.01216.65
7.4.60.0140.00316.71
7.4.50.0140.00016.86
7.4.40.0130.00516.66
7.4.30.0150.00916.79
7.4.00.0050.01015.10
7.3.330.0000.00613.53
7.3.320.0000.00813.45
7.3.310.0040.00416.64
7.3.300.0040.00416.55
7.3.290.0050.00216.67
7.3.280.0100.00816.65
7.3.270.0070.01317.40
7.3.260.0060.01216.67
7.3.250.0130.00616.76
7.3.240.0080.01316.70
7.3.230.0040.01516.57
7.3.210.0140.00516.59
7.3.200.0120.00619.39
7.3.190.0130.00316.61
7.3.180.0130.00316.87
7.3.170.0090.01116.62
7.3.160.0070.01016.57
7.3.120.0090.00715.09
7.3.110.0090.00915.10
7.3.100.0070.01115.09
7.3.90.0110.00515.11
7.3.80.0020.01315.09
7.3.70.0060.00614.89
7.3.60.0110.00415.06
7.3.50.0050.01015.19
7.3.40.0110.00415.18
7.3.30.0030.01215.17
7.3.20.0060.00816.98
7.3.10.0090.00716.89
7.3.00.0040.00916.83
7.2.330.0070.01116.92
7.2.320.0120.00616.96
7.2.310.0140.00717.04
7.2.300.0150.00316.85
7.2.290.0070.01716.93
7.2.250.0120.00815.47
7.2.240.0140.00715.49
7.2.230.0070.00915.19
7.2.220.0060.00515.22
7.2.210.0060.01015.25
7.2.200.0080.00815.32
7.2.190.0020.01515.33
7.2.180.0030.00815.25
7.2.170.0020.01315.22
7.2.130.0090.00616.95
7.2.120.0150.00416.91
7.2.110.0060.00917.28
7.2.100.0060.00616.91
7.2.90.0070.00717.23
7.2.80.0030.01217.37
7.2.70.0040.01117.31
7.2.60.0080.00816.99
7.2.50.0070.00717.20
7.2.40.0030.01217.21
7.2.30.0060.00917.17
7.2.20.0000.01117.14
7.2.10.0030.01317.28
7.2.00.0020.01018.56
7.1.330.0030.01116.13
7.1.320.0050.00715.98
7.1.310.0120.00316.07
7.1.300.0070.00515.89
7.1.290.0070.00916.08
7.1.280.0050.01115.88
7.1.270.0080.00515.97
7.1.260.0070.00715.95
7.1.250.0090.00316.05
7.1.200.0040.01115.97
7.1.100.0000.00918.14
7.1.70.0040.00717.19
7.1.60.0120.01219.30
7.1.50.0040.00917.55
7.1.00.0000.07722.82
7.0.200.0040.00417.13
7.0.60.0170.07322.05
7.0.50.0070.09018.12
7.0.40.0130.08020.56
7.0.30.0370.07020.48
7.0.20.0330.05020.50
7.0.10.0130.08020.45
7.0.00.0000.05020.50
5.6.280.0070.03021.50
5.6.210.0070.05021.07
5.6.200.0170.07718.54
5.6.190.0130.08321.08
5.6.180.0430.05321.00
5.6.170.0370.07320.75
5.6.160.0070.06320.82
5.6.150.0030.08318.54
5.6.140.0030.04718.55
5.6.130.0070.06018.46
5.6.120.0100.08021.29
5.6.110.0030.05721.55
5.6.100.0100.04021.30
5.6.90.0070.08321.35
5.6.80.0200.07320.93
5.5.350.4170.04720.70
5.5.340.0030.04018.26
5.5.330.0100.08020.89
5.5.320.0670.06320.61
5.5.310.0100.04720.65
5.5.300.0070.05018.26
5.5.290.0170.07318.34
5.5.280.0100.08021.18
5.5.270.0100.08721.02
5.5.260.0200.06321.32
5.5.250.0170.07021.08
5.5.240.0170.07320.46

preferences:
51.92 ms | 401 KiB | 5 Q