3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar() { return ""; } } $ts = microtime(true); for ($i=1; $i<=10000; $i++) { $c = new Foo(); echo $c->bar(); unset ($c); } $tt = microtime(true); unset($ts, $tt); $t1 = $tt-$ts; echo "Variable Instantiation takes {$t1} seconds\n"; $ts = microtime(true); for ($i=1; $i<=10000; $i++) { echo (new Foo())->bar(); } $tt = microtime(true); unset($ts, $tt); $t2 = $tt-$ts; echo "Magic Instantiation takes {$t2} seconds\n"; echo "\n";

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)
7.2.00.0000.01419.30
7.1.70.0030.01617.20
7.1.60.0070.01719.25
7.1.50.0150.00316.63
7.1.00.0000.07322.33
7.0.200.0030.00616.82
7.0.140.0070.07322.18
7.0.120.0070.07022.18
7.0.60.0000.05319.94
7.0.50.0070.04017.88
7.0.40.0030.09020.02
7.0.30.0200.09020.05
7.0.20.0230.08320.11
7.0.10.0000.05020.06
7.0.00.0030.09020.05
5.6.280.0100.07720.91
5.6.210.0170.07720.63
5.6.200.0070.06318.23
5.6.190.0000.10020.68
5.6.180.0070.05320.69
5.6.170.0300.05320.57
5.6.160.0100.05720.56
5.6.150.0030.06718.15
5.6.140.0070.05018.13
5.6.130.0130.06718.18
5.6.120.0070.07721.12
5.6.110.0070.07721.14
5.6.100.0100.08720.91
5.6.90.0100.08321.08
5.6.80.0100.08320.39
5.5.350.0070.08320.50
5.5.340.0030.04317.93
5.5.330.0070.04320.34
5.5.320.0400.07320.34
5.5.310.0400.07720.26
5.5.300.0130.08018.05
5.5.290.0070.08018.09
5.5.280.0070.09020.66
5.5.270.0170.07720.85
5.5.260.0100.07720.87
5.5.250.0070.09720.69
5.5.240.0170.07320.16
5.4.450.0030.08719.25
5.4.440.0200.03019.47
5.4.430.0130.07719.56
5.4.420.0100.08319.44
5.4.410.0030.06319.31
5.4.400.0030.05019.25
5.4.390.0100.06719.12
5.4.380.0030.04318.87
5.4.370.0030.08719.16
5.4.360.0030.04319.16
5.4.350.0070.08019.25
5.4.340.0170.05319.24
5.4.320.0070.04318.85
5.4.310.0070.04018.86
5.4.300.0070.04018.87
5.4.290.0030.04318.84
5.4.280.0030.05019.00
5.4.270.0000.04318.87
5.4.260.0000.04319.07
5.4.250.0030.04019.14
5.4.240.0030.04019.11
5.4.230.0070.03719.16
5.4.220.0030.04318.84
5.4.210.0130.03019.14
5.4.200.0030.04018.86
5.4.190.0030.04018.86
5.4.180.0030.04019.14
5.4.170.0000.04319.14
5.4.160.0000.04319.18
5.4.150.0030.05019.13
5.4.140.0100.03716.27
5.4.130.0030.03716.55
5.4.120.0000.04016.35
5.4.110.0070.03716.41
5.4.100.0000.04016.28
5.4.90.0070.03316.37
5.4.80.0000.04316.41
5.4.70.0030.04016.26
5.4.60.0030.03716.36
5.4.50.0070.03316.44
5.4.40.0000.04716.27
5.4.30.0030.03716.44
5.4.20.0030.04016.42
5.4.10.0070.08316.64
5.4.00.0000.05715.79
5.3.290.0100.06014.72
5.3.280.0000.04014.65
5.3.270.0000.04314.66
5.3.260.0000.04314.66
5.3.250.0130.02714.63
5.3.240.0070.03314.50
5.3.230.0000.04014.76
5.3.220.0030.04014.73
5.3.210.0070.03714.56
5.3.200.0070.03714.59
5.3.190.0000.04014.48
5.3.180.0030.04314.62
5.3.170.0030.03314.64
5.3.160.0100.04014.58
5.3.150.0030.04014.61
5.3.140.0070.03014.72
5.3.130.0070.07014.64
5.3.120.0030.04714.56
5.3.110.0070.07314.55
5.3.100.0070.07314.07
5.3.90.0070.04314.09
5.3.80.0070.03313.93
5.3.70.0030.04314.06
5.3.60.0000.04014.00
5.3.50.0130.07313.97
5.3.40.0070.03713.95
5.3.30.0030.04313.88
5.3.20.0030.06713.85
5.3.10.0070.07313.66
5.3.00.0070.06713.71
5.2.170.0000.03711.04
5.2.160.0070.06311.29
5.2.150.0030.06311.16
5.2.140.0030.03011.03
5.2.130.0170.03011.11
5.2.120.0000.03711.02
5.2.110.0070.04711.10
5.2.100.0130.06011.06
5.2.90.0030.03011.12
5.2.80.0030.04011.04
5.2.70.0070.06011.06
5.2.60.0070.03311.05
5.2.50.0000.04010.94
5.2.40.0070.06310.88
5.2.30.0000.03310.93
5.2.20.0030.03010.88
5.2.10.0030.03710.85
5.2.00.0030.03310.68
5.1.60.0000.03310.04
5.1.50.0100.04310.15
5.1.40.0030.0439.89
5.1.30.0000.05310.39
5.1.20.0030.03010.51
5.1.10.0000.03010.09
5.1.00.0030.03710.06
5.0.50.0070.0238.63
5.0.40.0000.0278.63
5.0.30.0070.0438.63
5.0.20.0000.0378.63
5.0.10.0030.0438.63
5.0.00.0100.0608.63
4.4.90.0070.0208.63
4.4.80.0000.0278.63
4.4.70.0070.0338.63
4.4.60.0070.0178.63
4.4.50.0000.0278.63
4.4.40.0030.0408.63
4.4.30.0030.0308.63
4.4.20.0000.0208.63
4.4.10.0000.0408.63
4.4.00.0070.0438.63
4.3.110.0030.0238.63
4.3.100.0070.0338.63
4.3.90.0030.0208.63
4.3.80.0000.0408.63
4.3.70.0000.0378.63
4.3.60.0030.0308.63
4.3.50.0030.0238.63
4.3.40.0070.0408.63
4.3.30.0000.0378.63
4.3.20.0070.0208.63
4.3.10.0030.0178.63
4.3.00.0000.0178.63

preferences:
30.83 ms | 400 KiB | 5 Q