3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if (!function_exists('interface_exists')) { die('PHP version too old'); } $throwables = listThrowableClasses(); $throwablesPerParent = splitInParents($throwables); printTree($throwablesPerParent); if (count($throwablesPerParent) !== 0) { die('ERROR!!!'); } function listThrowableClasses() { $result = array(); if (interface_exists('Throwable')) { foreach (get_declared_classes() as $cn) { $implements = class_implements($cn); if (isset($implements['Throwable'])) { $result[] = $cn; } } } else { foreach (get_declared_classes() as $cn) { if ($cn === 'Exception' || is_subclass_of($cn, 'Exception')) { $result[] = $cn; } } } return $result; } function splitInParents($classes) { $result = array(); foreach ($classes as $cn) { $parent = (string) get_parent_class($cn); if (isset($result[$parent])) { $result[$parent][] = $cn; } else { $result[$parent] = array($cn); } } return $result; } function printTree(&$tree) { if (!isset($tree[''])) { die('No root classes!!!'); } printLeaves($tree, '', 0); } function printLeaves(&$tree, $parent, $level) { if (isset($tree[$parent])) { $leaves = $tree[$parent]; unset($tree[$parent]); natcasesort($leaves); $leaves = array_values($leaves); $count = count($leaves); for ($i = 0; $i < $count; $i++) { $leaf = $leaves[$i]; echo str_repeat(' ', $level), $leaf, "\n"; printLeaves($tree, $leaf, $level + 1); } } }

Here you find the average performance (time & memory) of each version. A greyed out version indicates it didn't complete successfully (based on exit-code).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.2.00.0450.01017.89
7.1.120.0470.00717.11
7.1.110.0200.01217.05
7.1.100.0230.01017.03
7.1.90.0260.01216.92
7.1.80.0160.01516.95
7.1.70.0130.01516.01
7.1.60.0390.01433.93
7.1.50.0380.00933.74
7.1.40.0320.01433.26
7.1.30.0310.01433.40
7.1.20.0300.01233.37
7.1.10.0180.01215.39
7.1.00.0220.01315.47
7.0.260.0460.00616.68
7.0.250.0210.00916.55
7.0.240.0200.01016.55
7.0.230.0170.01616.78
7.0.220.0220.01016.47
7.0.210.0260.00915.63
7.0.200.0190.01015.68
7.0.190.0370.01315.68
7.0.180.0200.01015.17
7.0.170.0250.00915.08
7.0.160.0170.01015.02
7.0.150.0190.01514.99
7.0.140.0220.00915.20
7.0.130.0250.01015.35
7.0.120.0370.01215.33
7.0.110.0140.01015.18
7.0.100.0180.00915.22
7.0.90.0230.00615.27
7.0.80.0150.00815.25
7.0.70.0190.01015.12
7.0.60.0180.00915.08
7.0.50.0140.01015.36
7.0.40.0170.00915.41
7.0.30.0170.00815.27
7.0.20.0160.01315.23
7.0.10.0220.01215.27
7.0.00.0160.01015.25
hhvm-3.22.00.0940.22591.53
hhvm-3.21.30.0850.23291.58
hhvm-3.21.00.0810.23491.15
hhvm-3.20.20.0830.20591.58
hhvm-3.19.20.0570.21790.14
hhvm-3.18.50.0750.22189.20
hhvm-3.18.40.0810.22489.23
hhvm-3.17.30.0780.19888.40
hhvm-3.15.40.0630.19185.94
hhvm-3.13.20.0780.16897.38
hhvm-3.12.140.0720.20096.42
hhvm-3.11.10.0690.18488.24
hhvm-3.10.10.0470.18485.18
5.6.300.0110.06720.74
5.6.290.0160.06120.93
5.6.280.0170.07120.95
5.6.270.0110.06420.88
5.6.260.0070.06820.82
5.6.250.0150.06320.82
5.6.240.0160.06520.92
5.6.230.0120.06320.86
5.6.220.0140.06720.82
5.6.210.0090.06520.99
5.6.200.0110.06220.83
5.6.190.0170.05620.78
5.6.180.0100.07220.82
5.6.170.0130.05920.91
5.6.160.0090.06820.80
5.6.150.0130.06020.88
5.6.140.0070.06520.77
5.6.130.0110.05820.81
5.6.120.0150.06520.93
5.6.110.0110.07720.84
5.6.100.0120.06320.94
5.6.90.0150.05720.83
5.6.80.0110.06420.24
5.6.70.0130.06320.21
5.6.60.0110.05720.20
5.6.50.0090.06020.26
5.6.40.0050.07020.13
5.6.30.0090.05720.20
5.6.20.0110.05720.18
5.6.10.0130.05520.24
5.6.00.0120.05520.17
5.5.380.0140.05417.45
5.5.370.0220.04817.44
5.5.360.0130.06117.44
5.5.350.0090.05717.39
5.5.340.0120.05317.93
5.5.330.0040.06417.91
5.5.320.0100.05518.04
5.5.310.0160.05418.00
5.5.300.0070.06518.00
5.5.290.0130.05717.97
5.5.280.0130.06617.96
5.5.270.0140.05517.89
5.5.260.0180.05918.01
5.5.250.0100.05917.87
5.5.240.0110.06017.26
5.5.230.0080.07217.39
5.5.220.0120.05917.39
5.5.210.0110.05517.42
5.5.200.0100.05217.39
5.5.190.0110.05317.35
5.5.180.0110.05417.25
5.5.160.0110.05217.35
5.5.150.0110.05917.20
5.5.140.0090.06617.39
5.5.130.0160.05317.42
5.5.120.0100.05917.38
5.5.110.0130.05217.38
5.5.100.0090.06917.02
5.5.90.0150.05617.21
5.5.80.0160.06417.29
5.5.70.0080.06617.06
5.5.60.0120.06317.13
5.5.50.0090.06917.08
5.5.40.0110.05017.15
5.5.30.0140.05117.22
5.5.20.0080.05817.21
5.5.10.0110.05617.14
5.5.00.0130.05317.27
5.4.450.0100.06219.36
5.4.440.0110.06519.31
5.4.430.0120.05919.29
5.4.420.0100.06819.35
5.4.410.0090.05819.28
5.4.400.0120.05519.01
5.4.390.0090.06019.06
5.4.380.0100.05719.08
5.4.370.0090.05119.08
5.4.360.0140.05218.99
5.4.350.0070.05719.04
5.4.340.0080.05719.08
5.4.320.0110.05619.07
5.4.310.0160.05718.99
5.4.300.0150.06319.15
5.4.290.0160.06418.92
5.4.280.0130.06518.99
5.4.270.0090.05519.05
5.4.260.0120.05318.96
5.4.250.0130.06118.92
5.4.240.0100.06318.98
5.4.230.0070.06018.97
5.4.220.0110.07319.05
5.4.210.0100.05719.01
5.4.200.0100.05519.11
5.4.190.0070.06619.00
5.4.180.0120.05918.92
5.4.170.0080.05918.95
5.4.160.0130.05218.92
5.4.150.0150.05619.00
5.4.140.0070.05416.67
5.4.130.0100.04916.56
5.4.120.0080.05416.69
5.4.110.0080.05516.67
5.4.100.0080.05116.62
5.4.90.0120.04516.65
5.4.80.0110.05116.60
5.4.70.0060.05716.67
5.4.60.0080.05616.57
5.4.50.0110.04616.49
5.4.40.0060.05416.68
5.4.30.0090.05516.54
5.4.20.0110.04816.61
5.4.10.0060.05316.66
5.4.00.0090.05116.01
5.3.290.0080.06714.77
5.3.280.0110.05914.74
5.3.270.0130.05014.86
5.3.260.0120.05314.78
5.3.250.0120.04614.79
5.3.240.0100.05014.90
5.3.230.0120.05014.86
5.3.220.0120.04714.85
5.3.210.0060.05514.79
5.3.200.0100.05014.76
5.3.190.0140.04514.85
5.3.180.0070.05814.70
5.3.170.0120.05314.88
5.3.160.0130.04914.74
5.3.150.0140.04914.81
5.3.140.0060.05614.79
5.3.130.0150.04614.83
5.3.120.0090.05914.81
5.3.110.0110.05814.78
5.3.100.0110.04914.15
5.3.90.0110.05214.20
5.3.80.0110.04814.30
5.3.70.0120.05014.21
5.3.60.0060.05114.26
5.3.50.0090.04814.19
5.3.40.0090.05814.10
5.3.30.0130.04914.03
5.3.20.0080.05513.82
5.3.10.0060.06513.80
5.3.00.0070.05013.85
5.2.170.0070.04611.16
5.2.160.0090.04611.37
5.2.150.0090.04511.34
5.2.140.0090.04411.40
5.2.130.0120.03911.35
5.2.120.0060.04711.23
5.2.110.0070.04111.30
5.2.100.0030.04111.24
5.2.90.0050.04911.34
5.2.80.0080.04011.32
5.2.70.0040.04311.27
5.2.60.0080.04011.28
5.2.50.0090.03811.13
5.2.40.0080.04511.14
5.2.30.0090.04511.12
5.2.20.0070.04011.14
5.2.10.0090.03611.12
5.2.00.0080.03810.88
5.1.60.0030.03510.21
5.1.50.0080.03710.14
5.1.40.0050.03710.28
5.1.30.0080.03610.50
5.1.20.0030.04510.56
5.1.10.0050.04010.28
5.1.00.0110.03610.33
5.0.50.0090.0349.11
5.0.40.0050.0339.12
5.0.30.0040.0469.08
5.0.20.0080.0279.05
5.0.10.0060.0289.00
5.0.00.0010.0478.96
4.4.90.0030.0228.50
4.4.80.0020.0248.50
4.4.70.0030.0228.50
4.4.60.0030.0218.50
4.4.50.0010.0248.50
4.4.40.0030.0378.50
4.4.30.0010.0258.50
4.4.20.0130.0288.50
4.4.10.0030.0258.50
4.4.00.0030.0408.50
4.3.110.0070.0218.50
4.3.100.0040.0218.50
4.3.90.0010.0258.50
4.3.80.0040.0318.50
4.3.70.0050.0208.50
4.3.60.0030.0258.50
4.3.50.0030.0298.50
4.3.40.0040.0378.50
4.3.30.0030.0268.50
4.3.20.0030.0278.50
4.3.10.0040.0258.50
4.3.00.0040.0248.50