3v4l.org

run code in 500+ PHP versions simultaneously
<?php $default = 'hacs.xyz'; $url = ltrim($_GET['u'] ?? $_SERVER['QUERY_STRING'] ?? $_SERVER['REQUEST_URI'] ?? '', '/') ?: $default; $url = preg_replace('#^index\.php/#i', '', $url); if (in_array($url, ['', 'favicon.ico', 'opensearch.xml'])) { exit(); } if (!preg_match('/https?:/i', $url)) { $url = "https://$url"; } list($body, $headers) = request($url); foreach ($headers as $k => $v) { if (in_array(strtolower($k), ['content-type', 'content-encoding'])) { header("$k: $v"); } } echo $body; function request($url) { error_log($url); $ua = $_SERVER['HTTP_USER_AGENT'] ?? 'Mozilla/5.0 Chrome/139'; $headers = ["Content-Type: $ua\r\n"]; if ($ref = $_SERVER['HTTP_REFERER'] ?? '') { $headers[] = "Referer: $ref\r\n"; } $http = [ 'method' => 'GET', 'header' => join($headers), ]; $context = stream_context_create(compact('http')); $body = file_get_contents($url, false, $context); $headers = array_reduce($http_response_header ?? [], function ($dat, $head) { $arr = explode(':', $head, 2); if (isset($arr[1])) { $dat[$arr[0]] = trim($arr[1]); } return $dat; }, []); if ($location = $headers['Location'] ?? $headers['location'] ?? null) { if (str_starts_with($location, '/')) { $schema = parse_url($url, PHP_URL_SCHEME); $host = parse_url($url, PHP_URL_HOST); $location = "$schema://$host$location"; } return request($location); } return [$body, $headers]; }

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.5.30.0110.00818.03
8.5.20.0110.00720.25
8.5.10.0090.00916.90
8.5.00.0130.00722.99
8.4.180.0130.00919.86
8.4.170.0140.00824.11
8.4.160.0110.01022.31
8.4.150.0070.00617.93
8.4.140.0110.01018.29
8.4.130.0110.00718.13
8.4.120.0440.00918.32
8.4.110.0410.01117.96
8.4.100.0420.00918.31
8.4.90.0420.01117.98
8.4.80.0350.01018.16
8.4.70.0410.01017.93
8.4.60.0260.00318.38
8.4.50.0180.00518.38
8.4.40.0280.00117.77
8.4.30.0360.01117.92
8.4.20.0500.00317.89
8.4.10.0470.01017.81
8.3.300.0120.00920.82
8.3.290.0040.00420.74
8.3.280.0130.00718.60
8.3.270.0120.00816.79
8.3.260.0140.00616.86
8.3.250.0230.00716.98
8.3.240.0240.00316.81
8.3.230.0440.00916.75
8.3.220.0260.00616.93
8.3.210.0190.00317.18
8.3.200.0410.00716.86
8.3.190.0330.00716.99
8.3.180.0520.00616.71
8.3.170.0260.00417.18
8.3.160.0440.01016.82
8.3.150.0430.00716.99
8.3.140.0310.00816.74
8.3.130.0350.01116.80
8.3.120.0350.01016.64
8.3.110.0300.00916.72
8.3.100.0240.01116.95
8.3.90.0400.00817.04
8.3.80.0300.00716.74
8.3.70.0220.00817.11
8.3.60.0430.00716.93
8.3.50.0420.01116.72
8.3.40.0410.00617.76
8.3.30.0300.01117.99
8.3.20.0390.00617.96
8.3.10.0320.00617.95
8.3.00.0380.00817.90
8.2.300.0140.00820.45
8.2.290.0290.00816.77
8.2.280.0320.01116.70
8.2.270.0410.00816.52
8.2.260.0260.00416.64
8.2.250.0140.00616.95
8.2.240.0360.00616.53
8.2.230.0360.00616.60
8.2.220.0330.00716.61
8.2.210.0370.00916.57
8.2.200.0400.00716.59
8.2.190.0380.00816.78
8.2.180.0320.01116.63
8.2.170.0370.00918.07
8.2.160.0310.00218.05
8.2.150.0170.00517.86
8.2.140.0340.00817.69
8.2.130.0430.00717.69
8.2.120.0370.00717.77
8.2.110.0300.00717.82
8.2.100.0330.00717.76
8.2.90.0250.00617.82
8.2.80.0350.00517.77
8.2.70.0210.01017.70
8.2.60.0390.00617.50
8.2.50.0470.01017.73
8.2.40.0310.01217.61
8.2.30.0350.00917.57
8.2.20.0360.00617.68
8.2.10.0240.00317.52
8.2.00.0140.00517.64
8.1.340.0110.00921.88

preferences:
59.14 ms | 873 KiB | 5 Q