3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(php_uname('s')); $base_dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR; file_put_contents($base_dir . 'Baz.php', "<?php namespace Foo\Bar; class BAZ {}"); file_put_contents($base_dir . 'Buz.php', "<?php namespace Foo\Bar; class Buz {}"); spl_autoload_register(function ($class) { // project-specific namespace prefix $prefix = 'Foo\\Bar\\'; // base directory for the namespace prefix global $base_dir; # = __DIR__ . '/src/'; // does the class use the namespace prefix? $len = strlen($prefix); if (strncmp($prefix, $class, $len) !== 0) { // no, move to the next registered autoloader return; } // get the relative class name $relative_class = substr($class, $len); // replace the namespace prefix with the base directory, replace namespace // separators with directory separators in the relative class name, append // with .php $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; // if the file exists, require it if (file_exists($file)) { require $file; } }); $c1 = new \Foo\Bar\Baz(); $c2 = new \Foo\Bar\BAZ(); var_dump($c1 == $c2); $c3 = new \Foo\Bar\BUZ(); $c4 = new \Foo\Bar\Buz(); var_dump($c3 == $c4);

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.0040.01116.50
8.3.50.0110.00816.55
8.3.40.0130.00718.86
8.3.30.0100.00618.91
8.3.20.0040.00418.80
8.3.10.0000.00918.66
8.3.00.0030.00619.38
8.2.180.0160.01016.88
8.2.170.0150.00022.96
8.2.160.0110.00320.43
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0160.00321.00
8.2.110.0000.01019.23
8.2.100.0100.00317.91
8.2.90.0000.00921.11
8.2.80.0040.00419.33
8.2.70.0060.00317.50
8.2.60.0060.00317.80
8.2.50.0080.00018.07
8.2.40.0040.00417.99
8.2.30.0050.00318.20
8.2.20.0040.00417.68
8.2.10.0000.00817.84
8.2.00.0040.00417.71
8.1.280.0070.00725.92
8.1.270.0040.00424.66
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0090.00022.53
8.1.230.0080.00320.91
8.1.220.0030.00517.78
8.1.210.0030.00518.97
8.1.200.0060.00317.35
8.1.190.0040.00417.41
8.1.180.0080.00018.10
8.1.170.0060.00320.67
8.1.160.0000.00718.91
8.1.150.0040.00418.63
8.1.140.0040.00417.48
8.1.130.0000.00817.90
8.1.120.0030.00717.41
8.1.110.0050.00317.44
8.1.100.0000.00817.55
8.1.90.0000.00717.41
8.1.80.0040.00417.54
8.1.70.0000.00717.39
8.1.60.0080.00317.62
8.1.50.0050.00317.62
8.1.40.0080.00017.57
8.1.30.0040.00417.69
8.1.20.0040.00417.63
8.1.10.0000.00717.54
8.1.00.0030.00517.51
8.0.300.0080.00019.98
8.0.290.0000.00716.88
8.0.280.0000.00718.52
8.0.270.0050.00217.18
8.0.260.0030.00316.96
8.0.250.0000.00716.99
8.0.240.0080.00017.07
8.0.230.0040.00416.98
8.0.220.0030.00317.01
8.0.210.0040.00417.01
8.0.200.0000.00717.11
8.0.190.0000.00717.07
8.0.180.0100.00017.04
8.0.170.0080.00017.04
8.0.160.0040.00316.93
8.0.150.0000.00816.88
8.0.140.0110.00016.87
8.0.130.0030.00313.44
8.0.120.0030.00516.89
8.0.110.0000.00817.07
8.0.100.0020.00516.89
8.0.90.0070.00017.10
8.0.80.0090.00617.09
8.0.70.0030.00516.93
8.0.60.0060.00316.80
8.0.50.0070.00017.07
8.0.30.0140.01417.36
8.0.20.0080.01017.04
8.0.10.0080.00016.90
8.0.00.0070.01816.83
7.4.330.0020.00213.02
7.4.320.0070.00016.66
7.4.300.0000.00616.61
7.4.290.0030.00316.66
7.4.280.0040.00416.51
7.4.270.0070.00016.57
7.4.260.0050.00013.24
7.4.250.0000.00916.64
7.4.240.0050.00316.63
7.4.230.0000.00716.71
7.4.220.0090.01616.51
7.4.210.0120.00516.57
7.4.200.0040.00416.64
7.4.190.0070.00016.46
7.4.160.0070.01016.55
7.4.150.0120.00616.36
7.4.140.0090.00916.61
7.4.130.0120.00516.71
7.4.120.0100.00716.62
7.4.110.0030.01616.63
7.4.100.0130.00616.52
7.4.90.0180.00016.63
7.4.80.0060.01019.39
7.4.70.0060.01216.75
7.4.60.0090.00916.43
7.4.50.0090.00416.57
7.4.40.0030.01016.63
7.4.30.0100.00716.64
7.4.00.0060.01115.00
7.3.330.0030.00513.36
7.3.320.0030.00313.29
7.3.310.0000.00716.54
7.3.300.0000.00716.34
7.3.290.0060.01016.53
7.3.280.0120.00516.50
7.3.270.0070.01016.60
7.3.260.0030.01416.48
7.3.250.0050.01616.54
7.3.240.0110.00516.63
7.3.230.0100.00716.43
7.3.210.0090.01116.48
7.3.200.0130.01116.64
7.3.190.0100.00716.52
7.3.180.0110.00716.54
7.3.170.0060.01216.66
7.3.160.0100.00716.78
7.3.120.0020.01014.99
7.3.110.0070.01114.98
7.3.100.0030.01215.14
7.3.90.0090.00314.82
7.3.80.0060.00314.91
7.3.70.0000.00914.91
7.3.60.0060.01014.94
7.3.50.0030.01314.93
7.3.40.0070.00714.63
7.3.30.0070.01014.61
7.3.20.0060.00916.90
7.3.10.0040.00816.70
7.3.00.0050.00616.67
7.2.330.0060.01616.84
7.2.320.0130.01016.73
7.2.310.0060.01516.80
7.2.300.0100.01016.78
7.2.290.0120.00816.79
7.2.250.0000.01815.08
7.2.240.0030.01714.77
7.2.230.0060.01015.11
7.2.220.0030.00615.25
7.2.210.0030.00915.09
7.2.200.0090.00615.27
7.2.190.0100.00315.02
7.2.180.0130.00714.91
7.2.170.0070.00314.94
7.2.130.0060.00616.76
7.2.120.0090.00716.57
7.2.110.0070.00716.61
7.2.100.0070.01316.84
7.2.90.0040.00716.77
7.2.80.0030.01016.86
7.2.70.0100.00316.73
7.2.60.0090.00616.70
7.2.50.0120.00317.00
7.2.40.0140.00316.73
7.2.30.0050.01117.10
7.2.20.0030.00916.80
7.2.10.0080.00316.78
7.2.00.0150.01218.09
7.1.330.0060.00615.56
7.1.320.0100.00015.56
7.1.310.0030.00915.94
7.1.300.0060.01215.68
7.1.290.0000.00915.92
7.1.280.0030.01215.82
7.1.270.0130.00315.62
7.1.260.0080.00015.82
7.1.250.0080.00315.58
7.1.200.0030.01015.55
7.1.100.0030.01118.30
7.1.70.0060.00317.24
7.1.60.0030.01719.40
7.1.50.0120.00917.15
7.1.00.0070.05022.38
7.0.200.0040.00416.46
7.0.140.0100.06322.00
7.0.120.0070.06722.07
7.0.60.0070.08019.87
7.0.50.0170.06317.92
7.0.40.0000.04720.09
7.0.30.0130.04720.27
7.0.20.0330.06320.25
7.0.10.0100.05320.19
7.0.00.0070.06320.23
5.6.280.0100.07020.92
5.6.210.0130.06720.54
5.6.200.0070.08318.22
5.6.190.0000.04320.65
5.6.180.3930.05020.48
5.6.170.0330.05020.58
5.6.160.0100.04020.58
5.6.150.0130.07318.22
5.6.140.0070.07018.27
5.6.130.0000.05018.29
5.6.120.0000.07321.00
5.6.110.0030.08721.04
5.6.100.0130.07321.09
5.6.90.0100.07320.98
5.6.80.0100.07720.39
5.6.70.4500.03720.49
5.5.350.3970.04020.34
5.5.340.0030.04317.98
5.5.330.0100.05020.30
5.5.320.4030.04320.36
5.5.310.0430.07020.20
5.5.300.0070.04018.09
5.5.290.0030.08317.93
5.5.280.0030.04720.89
5.5.270.0170.07320.75
5.5.260.0070.08020.81
5.5.250.0100.06320.63
5.5.240.0270.03320.05
5.4.450.0000.04319.36
5.4.440.0070.03719.58
5.4.430.0030.04019.47
5.4.420.0100.03319.58
5.4.410.0030.03719.35
5.4.400.0070.07719.17
5.4.390.0030.06018.93
5.4.380.0100.03319.23
5.4.370.0070.05319.15
5.4.360.0070.07719.01
5.4.350.0130.07319.17
5.4.340.0070.07019.25
5.4.320.0030.04019.25
5.4.310.0070.05019.16
5.4.300.0100.07319.12
5.4.290.0070.07719.15
5.4.280.0170.06018.88
5.4.270.0100.04018.86
5.4.260.0070.04718.98
5.4.250.0030.05718.87
5.4.240.0130.05719.14
5.4.230.0100.05019.16
5.4.220.0100.04019.24
5.4.210.0130.04319.24
5.4.200.0130.06018.89
5.4.190.0100.05718.94
5.4.180.0030.07718.98
5.4.170.0100.04319.24
5.4.160.0130.06319.13
5.4.150.0100.04719.23
5.4.140.0030.05716.49
5.4.130.0070.03716.47
5.4.120.0000.04016.42
5.4.110.0030.06016.44
5.4.100.0130.06316.42
5.4.90.0070.07316.29
5.4.80.0130.03716.40
5.4.70.0100.03016.43
5.4.60.0070.03316.28
5.4.50.0100.03716.35
5.4.40.0070.03716.41
5.4.30.0030.03716.65
5.4.20.0130.06316.42
5.4.10.0000.04316.39
5.4.00.0070.07015.88
5.3.290.0070.03714.75
5.3.280.0000.04714.63
5.3.270.0030.04014.62
5.3.260.0030.05314.69
5.3.250.0070.08014.78
5.3.240.0100.03714.66
5.3.230.0030.06014.54
5.3.220.0070.04014.57
5.3.210.0100.07014.58
5.3.200.0130.03014.62
5.3.190.0100.04314.57
5.3.180.0000.04714.61
5.3.170.0030.04014.63
5.3.160.0070.03314.62
5.3.150.0130.06314.62
5.3.140.0070.04314.56
5.3.130.0030.04014.61
5.3.120.0030.03714.57
5.3.110.0100.06714.62
5.3.100.0070.07314.06
5.3.90.0100.03014.05
5.3.80.0070.04014.09
5.3.70.0000.04714.03
5.3.60.0070.07714.08
5.3.50.0000.07313.93
5.3.40.0070.04313.88
5.3.30.0100.06713.87
5.3.20.0070.07713.71
5.3.10.0070.03313.82
5.3.00.0070.03713.66
5.2.170.0000.05711.00
5.2.160.0070.03711.08
5.2.150.0000.03711.04
5.2.140.0100.04711.13
5.2.130.0030.06311.18
5.2.120.0030.03711.03
5.2.110.0100.05711.00
5.2.100.0030.06011.04
5.2.90.0070.03310.92
5.2.80.0070.05311.25
5.2.70.0030.05310.98
5.2.60.0030.03711.20
5.2.50.0030.03710.84
5.2.40.0100.03010.92
5.2.30.0000.06310.88
5.2.20.0070.06010.94
5.2.10.0070.06010.85
5.2.00.0030.06710.71
5.1.60.0030.0439.97
5.1.50.0070.02710.07
5.1.40.0130.0479.88
5.1.30.0070.05310.34
5.1.20.0000.06010.25
5.1.10.0000.03310.11
5.1.00.0100.02010.06
5.0.50.0070.0378.56
5.0.40.0070.0408.42
5.0.30.0070.0638.07
5.0.20.0000.0438.34
5.0.10.0000.0208.13
5.0.00.0030.0638.13
4.4.90.0000.0177.97
4.4.80.0000.0207.97
4.4.70.0000.0337.97
4.4.60.0100.0137.97
4.4.50.0000.0207.97
4.4.40.0100.0237.97
4.4.30.0030.0307.97
4.4.20.0000.0237.97
4.4.10.0100.0277.97
4.4.00.0030.0537.97
4.3.110.0030.0307.97
4.3.100.0000.0277.97
4.3.90.0000.0237.97
4.3.80.0030.0407.97
4.3.70.0100.0337.97
4.3.60.0070.0207.97
4.3.50.0000.0307.97
4.3.40.0030.0277.97
4.3.30.0000.0407.97
4.3.20.0070.0377.97
4.3.10.0000.0407.97
4.3.00.0070.0237.97

preferences:
56.57 ms | 400 KiB | 5 Q