3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); $cmd = 'php -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"'; $descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w')); $stdin = str_repeat('*', 4097); $options = array_merge(array('suppress_errors' => true, 'binary_pipes' => true, 'bypass_shell' => false)); $process = proc_open($cmd, $descriptors, $pipes, getcwd(), array(), $options); foreach ($pipes as $pipe) { stream_set_blocking($pipe, false); } $writePipes = array($pipes[0]); $stdinLen = strlen($stdin); $stdinOffset = 0; unset($pipes[0]); while ($pipes || $writePipes) { $r = $pipes; $w = $writePipes; $e = null; $n = stream_select($r, $w, $e, 60); if (false === $n) { break; } elseif ($n === 0) { proc_terminate($process); } if ($w) { $written = fwrite($writePipes[0], (binary)substr($stdin, $stdinOffset), 8192); if (false !== $written) { $stdinOffset += $written; } if ($stdinOffset >= $stdinLen) { fclose($writePipes[0]); $writePipes = null; } } foreach ($r as $pipe) { $type = array_search($pipe, $pipes); $data = fread($pipe, 8192); if (false === $data || feof($pipe)) { fclose($pipe); unset($pipes[$type]); } } }

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.0070.01416.63
8.3.50.0120.00816.48
8.3.40.0100.01018.97
8.3.30.0090.00618.66
8.3.20.0160.00018.77
8.3.10.0090.00018.54
8.3.00.0040.00419.26
8.2.180.0070.00716.75
8.2.170.0040.01122.96
8.2.160.0070.00720.34
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0080.00020.93
8.2.110.0000.00919.39
8.2.100.0070.00417.91
8.2.90.0000.00819.21
8.2.80.0050.00319.36
8.2.70.0040.00417.63
8.2.60.0040.00417.93
8.2.50.0030.00618.07
8.2.40.0040.00417.95
8.2.30.0000.00817.86
8.2.20.0030.00617.69
8.2.10.0080.00017.73
8.2.00.0040.00717.82
8.1.280.0070.00725.92
8.1.270.0030.00524.66
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0040.00821.73
8.1.230.0060.00620.91
8.1.220.0080.00018.77
8.1.210.0000.00819.03
8.1.200.0070.00317.35
8.1.190.0040.00417.52
8.1.180.0160.00318.10
8.1.170.0000.00718.77
8.1.160.0000.00718.73
8.1.150.0000.00718.55
8.1.140.0040.00417.32
8.1.130.0000.00717.80
8.1.120.0030.00717.45
8.1.110.0050.00217.40
8.1.100.0000.00717.44
8.1.90.0040.00417.45
8.1.80.0040.00417.43
8.1.70.0000.00717.39
8.1.60.0030.00717.42
8.1.50.0040.00417.38
8.1.40.0030.00517.57
8.1.30.0020.00517.52
8.1.20.0000.00817.65
8.1.10.0000.00917.46
8.1.00.0000.00817.53
8.0.300.0030.00719.86
8.0.290.0040.00416.75
8.0.280.0070.00018.47
8.0.270.0040.00417.09
8.0.260.0040.00416.88
8.0.250.0040.00416.95
8.0.240.0050.00216.93
8.0.230.0040.00416.96
8.0.220.0000.00716.81
8.0.210.0050.00216.91
8.0.200.0000.00616.86
8.0.190.0040.00416.92
8.0.180.0000.00716.82
8.0.170.0050.00516.92
8.0.160.0040.00417.03
8.0.150.0030.00616.85
8.0.140.0030.00616.83
8.0.130.0060.00013.39
8.0.120.0040.00416.80
8.0.110.0040.00416.98
8.0.100.0070.00016.92
8.0.90.0040.00416.81
8.0.80.0060.00916.97
8.0.70.0050.00316.72
8.0.60.0040.00416.78
8.0.50.0040.00416.77
8.0.30.0060.01216.93
8.0.20.0120.00617.11
8.0.10.0070.00017.08
8.0.00.0110.00816.92
7.4.330.0000.00513.15
7.4.320.0030.00316.60
7.4.300.0030.00316.62
7.4.290.0030.00316.65
7.4.280.0060.00316.44
7.4.270.0000.00716.67
7.4.260.0030.00313.39
7.4.250.0070.00316.61
7.4.240.0000.00716.44
7.4.230.0040.00416.54
7.4.220.0100.01716.58
7.4.210.0070.00716.63
7.4.200.0050.00216.65
7.4.190.0000.00716.79
7.4.160.0000.01616.56
7.4.150.0140.00316.45
7.4.140.0080.01016.46
7.4.130.0150.00516.52
7.4.120.0090.00916.60
7.4.110.0030.01416.43
7.4.100.0070.01116.68
7.4.90.0100.01016.55
7.4.80.0090.00919.39
7.4.70.0040.01516.65
7.4.60.0090.00616.40
7.4.50.0000.01316.45
7.4.40.0030.00916.66
7.4.30.0120.00616.54
7.4.00.0000.01514.91
7.3.330.0000.00613.13
7.3.320.0030.00313.07
7.3.310.0000.00716.25
7.3.300.0030.00316.45
7.3.290.0130.00616.37
7.3.280.0090.00816.46
7.3.270.0060.01216.64
7.3.260.0120.00616.57
7.3.250.0080.01216.41
7.3.240.0060.01216.42
7.3.230.0150.00316.36
7.3.210.0060.01316.48
7.3.200.0110.00516.51
7.3.190.0120.00416.45
7.3.180.0120.00316.63
7.3.170.0040.01416.57
7.3.160.0110.01116.50
7.3.120.0110.00314.74
7.2.330.0110.00716.66
7.2.320.0060.01116.75
7.2.310.0070.01016.48
7.2.300.0060.01216.84
7.2.290.0060.01116.50
7.2.01.6240.87719.32
7.1.101.4651.03618.05
7.1.71.2841.21717.23
7.1.61.5910.91017.34
7.1.50.0060.01617.08
7.1.01.5730.92722.19
7.0.201.6710.83016.96
7.0.140.0030.07722.21
7.0.121.4031.09722.15
7.0.60.0230.07720.05
7.0.50.0100.08017.67
7.0.40.0030.05020.19
7.0.30.0200.04320.33
7.0.20.0130.05720.20
7.0.10.0200.05720.20
7.0.00.0100.08320.12
5.6.210.0100.07320.66
5.6.200.0030.04718.20
5.6.190.0070.04020.40
5.6.180.4930.04020.45
5.6.170.0270.03720.49
5.6.160.0000.09320.50
5.6.150.0100.06318.22
5.6.140.0070.08318.20
5.6.130.0070.05018.27
5.6.120.0170.05321.15
5.6.110.0170.08021.04
5.6.100.0100.08021.05
5.6.90.0130.08321.12
5.6.80.0130.07320.40
5.6.70.4370.04320.43
5.5.350.4400.03320.49
5.5.340.0130.03318.03
5.5.330.0070.07720.43
5.5.320.4270.04020.51
5.5.310.0330.08020.21
5.5.300.0070.04018.00
5.5.290.0070.08018.08
5.5.280.0000.08020.89
5.5.270.0100.08020.89
5.5.260.0130.08320.70
5.5.250.0230.05720.73
5.5.240.0370.05320.29
5.4.450.0130.06019.47
5.4.440.0070.06319.41
5.4.430.0030.04319.34
5.4.420.0100.04719.16
5.4.410.0100.04319.13
5.4.400.0070.07319.21
5.4.390.0100.04719.20
5.4.380.0070.04319.18
5.4.370.0070.08018.94
5.4.360.0100.07019.13
5.4.350.0000.05019.20
5.4.340.0170.06019.20
5.4.320.0030.04319.02
5.4.310.0170.02719.16
5.4.300.0070.07018.93
5.4.290.0100.04019.14
5.4.280.0130.07019.19
5.4.270.0070.07019.17
5.4.260.0000.05019.10
5.4.250.0030.04718.80
5.4.240.0170.07019.21
5.4.230.0030.05019.07
5.4.220.0070.04719.15
5.4.210.0070.05019.07
5.4.200.0100.07319.18
5.4.190.0100.06718.82
5.4.180.0030.05018.80
5.4.170.0100.05718.92
5.4.160.0100.06018.79
5.4.150.0030.08019.13
5.4.140.0170.05716.36
5.4.130.0100.04716.34
5.4.120.0100.03716.25
5.4.110.0030.03716.43
5.4.100.0000.05016.43
5.4.90.0130.06016.65
5.4.80.0070.04016.32
5.4.70.0030.07716.32
5.4.60.0070.07316.29
5.4.50.0070.07016.29
5.4.40.0100.06016.26
5.4.30.0070.05316.39
5.4.20.0030.07016.29
5.4.10.0100.04716.34
5.4.00.0030.08015.75
5.3.290.0170.03014.64
5.3.280.0130.04014.43
5.3.270.0070.03714.63
5.3.260.0000.04714.46
5.3.250.0070.03314.57
5.3.240.0070.06014.58
5.3.230.0000.07014.58
5.3.220.0200.06014.56
5.3.210.0030.04014.50
5.3.200.0100.07714.48
5.3.190.0070.04014.57
5.3.180.0100.04714.55
5.3.170.0000.04314.70
5.3.160.0100.04714.39
5.3.150.0100.06314.53
5.3.140.0100.05014.61
5.3.130.0070.05314.53
5.3.120.0100.03714.46
5.3.110.0100.06314.38
5.3.100.0130.05714.01
5.3.90.0000.08014.07
5.3.80.0170.05013.89
5.3.70.0070.07314.02
5.3.60.0070.04713.88
5.3.50.0100.07013.92
5.3.40.0130.06713.91
5.3.30.0070.07713.88
5.3.20.0030.03713.57
5.3.10.0070.07313.51
5.3.00.0070.07313.66
5.2.170.0030.04311.12
5.2.160.0030.04711.12
5.2.150.0070.03011.34
5.2.140.0130.05311.18
5.2.130.0030.03711.02
5.2.120.0070.03011.13
5.2.110.0170.05311.07
5.2.100.0100.06311.15
5.2.90.0030.03011.11
5.2.80.0000.05710.98
5.2.70.0100.06311.02
5.2.60.0070.06011.07
5.2.50.0130.05310.99
5.2.40.0030.04010.96
5.2.30.0000.06710.90
5.2.20.0070.06010.96
5.2.10.0030.04010.78
5.2.00.0030.03310.78
5.1.60.0030.02710.70
5.1.50.0100.05010.70
5.1.40.0070.03010.70
5.1.30.0070.05310.70
5.1.20.0030.03710.70
5.1.10.0000.05710.70
5.1.00.0070.02710.70
5.0.50.0030.02710.70
5.0.40.0000.02310.70
5.0.30.0030.05710.70
5.0.20.0000.02710.70
5.0.10.0030.03310.70
5.0.00.0030.03310.70
4.4.90.0000.03710.70
4.4.80.0000.03710.70
4.4.70.0000.03710.70
4.4.60.0000.02310.70
4.4.50.0030.02310.70
4.4.40.0070.05310.70
4.4.30.0030.03710.70
4.4.20.0000.03710.70
4.4.10.0070.02310.70
4.4.00.0070.02710.70
4.3.110.0000.01710.70
4.3.100.0030.03310.70
4.3.90.0030.03010.70
4.3.80.0030.03710.70
4.3.70.0070.02010.70
4.3.60.0070.02710.70
4.3.50.0070.02310.70
4.3.40.0030.05010.70
4.3.30.0000.02010.70
4.3.20.0000.01710.70
4.3.10.0000.03710.70
4.3.00.0030.03710.70

preferences:
44.03 ms | 401 KiB | 5 Q