3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // File "load.php". namespace Foo\Bar { class load { static public function arithmetic() { require_once __DIR__ . '/arithmetic.php'; } } } // File "arithmetic.php". namespace Foo\Bar\Functions { function add($a, $b) { return $a + $b; } const add = 'Foo\Bar\Functions\add'; } // User app. namespace Some\App { use Foo\Bar\load; use Foo\Bar\Functions as f; load::arithmetic(); echo f\add(5, 6) . "\n"; // 11 $callable = f\add; echo $callable(5, 6); // 11 }
based on at8Z9

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).
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.0000.01419.29
7.1.100.0070.01118.11
7.1.70.0000.00717.23
7.1.60.0140.01119.50
7.1.50.0040.01116.87
7.1.00.0030.07722.34
7.0.200.0260.01016.70
7.0.140.0000.07721.95
7.0.60.0170.05020.02
7.0.50.0100.04717.86
7.0.40.0000.05720.29
7.0.30.0570.06320.27
7.0.20.0230.08320.23
7.0.10.0170.07720.21
7.0.00.0070.05320.26
5.6.280.0030.07321.05
5.6.210.0170.07020.51
5.6.200.0070.05318.20
5.6.190.0030.04320.61
5.6.180.2700.04720.48
5.6.170.0300.08020.53
5.6.160.0100.08020.52
5.6.150.0030.04018.24
5.6.140.0070.08018.18
5.6.130.0100.08018.19
5.6.120.0100.04020.99
5.6.110.0070.07721.14
5.6.100.0070.08321.01
5.6.90.0100.08721.11
5.6.80.0030.05720.41
5.5.350.4370.04320.43
5.5.340.0030.08017.95
5.5.330.0130.07720.44
5.5.320.0300.06020.32
5.5.310.0270.05020.38
5.5.300.0070.08017.99
5.5.290.0070.08018.09
5.5.280.0130.06320.79
5.5.270.0070.04020.89
5.5.260.0070.06720.97
5.5.250.0100.05720.57
5.5.240.0200.07720.35
5.4.450.0700.05319.16
5.4.440.0930.06019.61
5.4.430.0800.06019.57
5.4.420.0770.05319.55
5.4.410.0800.05319.04
5.4.400.1030.06018.77
5.4.390.0870.06718.57
5.4.380.1130.05318.48
5.4.370.1070.07318.79
5.4.360.1030.07018.86
5.4.350.1100.07018.77
5.4.340.1000.05718.62
5.4.320.1170.07018.76
5.4.310.1170.05718.73
5.4.300.1100.06018.73
5.4.290.1130.04718.81
5.4.280.0730.07018.46
5.4.270.0870.05318.47
5.4.260.0870.04718.74
5.4.250.0870.05718.69
5.4.240.0770.06018.84
5.4.230.0730.05018.50
5.4.220.1030.06018.78
5.4.210.0900.07018.71
5.4.200.0900.05716.64
5.4.190.0730.06018.84
5.4.180.0700.06718.51
5.4.170.1000.05018.77
5.4.160.0970.04718.78
5.4.150.0870.05318.45
5.4.140.0970.05716.48
5.4.130.1070.04716.29
5.4.120.0970.05716.38
5.4.110.1070.05316.37
5.4.100.1130.05716.20
5.4.90.1030.05016.34
5.4.80.1100.04716.27
5.4.70.1130.04716.26
5.4.60.1030.05316.43
5.4.50.1070.04716.23
5.4.40.0970.05716.19
5.4.30.1070.06016.27
5.4.20.0800.05316.20
5.4.10.0830.05016.38
5.4.00.0970.03715.65
5.3.290.0830.05314.65
5.3.280.0870.04714.80
5.3.270.0900.05714.74
5.3.260.0870.05314.89
5.3.250.0830.05014.59
5.3.240.0800.05714.79
5.3.230.0830.05314.77
5.3.220.0900.04314.57
5.3.210.0830.05014.70
5.3.200.0870.04714.63
5.3.190.0800.06014.55
5.3.180.1130.05314.55
5.3.170.1070.05314.86
5.3.160.1200.07014.63
5.3.150.1100.04714.70
5.3.140.1000.06014.60
5.3.130.1030.05314.55
5.3.120.0870.05314.61
5.3.110.0800.05714.57
5.3.100.0830.05314.24
5.3.90.1030.05014.21
5.3.80.1230.05014.19
5.3.70.1070.05714.31
5.3.60.1030.05013.99
5.3.50.1030.05014.06
5.3.40.1070.06014.09
5.3.30.0900.05713.98
5.3.20.0970.05013.70
5.3.10.0770.05713.86
5.3.00.0870.05013.78
5.2.170.0830.04711.17
5.2.160.0830.04011.18
5.2.150.0900.03711.06
5.2.140.0830.04311.18
5.2.130.0930.03311.15
5.2.120.0870.03311.25
5.2.110.1030.05011.05
5.2.100.0900.03011.14
5.2.90.0870.04711.08
5.2.80.0730.04011.25
5.2.70.0700.05011.14
5.2.60.0670.04011.18
5.2.50.0730.04011.00
5.2.40.0570.04011.02
5.2.30.0670.03711.01
5.2.20.0630.03710.93
5.2.10.0530.04310.91
5.2.00.0470.05310.71
5.1.60.0570.03310.03
5.1.50.0630.0409.96
5.1.40.0600.02710.00
5.1.30.0500.04010.32
5.1.20.0530.04010.38
5.1.10.0570.03010.11
5.1.00.0500.04010.13
5.0.50.0330.0238.59
5.0.40.0300.0278.38
5.0.30.0300.0408.28
5.0.20.0330.0238.39
5.0.10.0270.0308.35
5.0.00.0300.0408.18
4.4.90.0300.0175.89
4.4.80.0230.0235.94
4.4.70.0300.0275.91
4.4.60.0330.0175.89
4.4.50.0300.0205.86
4.4.40.0230.0405.88
4.4.30.0330.0175.87
4.4.20.0300.0205.92
4.4.10.0270.0275.93
4.4.00.0230.0375.94
4.3.110.0270.0235.81
4.3.100.0230.0235.78
4.3.90.0370.0205.78
4.3.80.0300.0305.86
4.3.70.0270.0235.91
4.3.60.0230.0235.78
4.3.50.0230.0275.85
4.3.40.0330.0305.84
4.3.30.0130.0234.54
4.3.20.0230.0174.64
4.3.10.0170.0234.52
4.3.00.0100.0237.02