3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { function doSomething($a) { return $a + 2; } } $start = microtime(true); $foo = new foo(); for ($i = 0; $i < 100000; $i++) { $foo->doSomething(1); } $end1 = (microtime(true) - $start); echo $end1 . PHP_EOL; $start = microtime(true); $foo = new foo(); $doSomething = new \reflectionMethod('foo', 'doSomething'); for ($i = 0; $i < 100000; $i++) { $doSomething->invoke($foo, 1); } $end2 = (microtime(true) - $start); echo $end2 . PHP_EOL; var_dump($end2 - $end1);

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.4.00.0100.03314.92
7.3.120.0140.03114.55
7.3.110.0060.03914.91
7.3.100.0090.02214.77
7.3.90.0070.02014.74
7.3.80.0030.03714.71
7.3.70.0070.02014.61
7.3.60.0130.02014.66
7.3.50.0030.02714.67
7.3.40.0000.02914.54
7.3.30.0100.02014.43
7.3.20.0070.02316.43
7.3.10.0090.02416.63
7.3.00.0060.02716.59
7.2.250.0130.03614.95
7.2.240.0100.03715.27
7.2.230.0070.02614.91
7.2.220.0000.02915.22
7.2.210.0100.02014.95
7.2.200.0070.02215.02
7.2.190.0100.02114.91
7.2.180.0070.02614.70
7.2.170.0090.02115.21
7.2.130.0100.02516.84
7.2.120.0080.02716.82
7.2.110.0110.01916.96
7.2.100.0070.02816.92
7.2.90.0100.02417.02
7.2.80.0100.02916.95
7.2.70.0150.02716.58
7.2.60.0070.02916.89
7.2.50.0140.02816.90
7.2.40.0100.03316.81
7.2.30.0050.02816.84
7.2.20.0140.02116.94
7.2.10.0110.02416.70
7.2.00.0090.02117.65
7.1.330.0130.02916.07
7.1.320.0030.03915.69
7.1.310.0100.03315.89
7.1.300.0030.04015.73
7.1.290.0030.03615.80
7.1.280.0030.03415.88
7.1.270.0130.03615.84
7.1.260.0030.04115.88
7.1.250.0030.04815.57
7.1.70.0030.04217.30
7.1.60.0070.04519.40
7.1.50.0100.02716.98
7.1.00.0030.09722.31
7.0.200.0030.01516.60
7.0.140.0030.09322.09
7.0.120.0070.09722.09
7.0.60.0070.09019.91
7.0.50.0100.09317.90
7.0.40.0000.05720.04
7.0.30.0600.07720.25
7.0.20.0200.07020.15
7.0.10.0130.07720.22
7.0.00.0030.10320.24
5.6.280.0070.12321.13
5.6.210.0070.12320.65
5.6.200.0070.12718.16
5.6.190.0130.12320.33
5.6.180.3630.07720.48
5.6.170.0270.08020.47
5.6.160.0070.07720.51
5.6.150.0100.12318.27
5.6.140.0130.12718.27
5.6.130.0030.11718.17
5.6.120.0030.14321.08
5.6.110.0100.13320.98
5.6.100.0070.07321.11
5.6.90.0130.13020.93
5.6.80.0100.09020.41
5.6.70.4430.07320.37
5.5.350.0100.07020.41
5.5.340.0000.07318.05
5.5.330.0130.11020.27
5.5.320.3830.07320.24
5.5.310.0300.09020.34
5.5.300.0170.08318.07
5.5.290.0030.08018.04
5.5.280.0000.07720.73
5.5.270.0100.13020.86
5.5.260.0100.11020.79
5.5.250.0030.14020.59
5.5.240.0300.10020.04
5.4.450.0030.07719.20
5.4.440.0030.07319.53
5.4.430.0100.06319.33
5.4.420.0000.07319.44
5.4.410.0030.07019.27
5.4.400.0070.08019.15
5.4.390.0100.09319.11
5.4.380.0130.12018.86
5.4.370.0130.12019.25
5.4.360.0130.11718.86
5.4.350.0270.07719.16
5.4.340.0100.06718.98
5.4.320.0030.08319.00
5.4.310.0230.09319.01
5.4.300.0100.10019.15
5.4.290.0200.12018.97
5.4.280.0070.12019.09
5.4.270.0070.12719.14
5.4.260.0070.09718.86
5.4.250.0170.11019.18
5.4.240.0030.08319.00
5.4.230.0070.07319.23
5.4.220.0100.12019.07
5.4.210.0100.12019.23
5.4.200.0070.08719.11
5.4.190.0030.08318.97
5.4.180.0070.11718.96
5.4.170.0100.06719.11
5.4.160.0170.11318.83
5.4.150.0100.12319.16
5.4.140.0030.12016.50
5.4.130.0100.12016.30
5.4.120.0100.11716.26
5.4.110.0030.12716.39
5.4.100.0000.07716.42
5.4.90.0100.11716.43
5.4.80.0070.07016.38
5.4.70.0070.13016.37
5.4.60.0130.08316.32
5.4.50.0100.11716.44
5.4.40.0070.12716.43
5.4.30.0030.07716.31
5.4.20.0100.11316.24
5.4.10.0100.11716.50
5.4.00.0070.12715.82
5.3.290.0130.13014.71
5.3.280.0130.09314.64
5.3.270.0100.09314.66
5.3.260.0170.13314.63
5.3.250.0070.10014.75
5.3.240.0000.12314.64
5.3.230.0070.14714.67
5.3.220.0170.12314.60
5.3.210.0030.14714.61
5.3.200.0030.10314.72
5.3.190.0070.09314.58
5.3.180.0000.08714.46
5.3.170.0000.14714.57
5.3.160.0130.14014.60
5.3.150.0070.13714.48
5.3.140.0100.13314.51
5.3.130.0070.14014.60
5.3.120.0070.14314.61
5.3.110.0030.14014.55
5.3.100.0070.14314.09
5.3.90.0030.13714.07
5.3.80.0130.13314.18
5.3.70.0000.14013.94
5.3.60.0130.13014.14
5.3.50.0130.13313.95
5.3.40.0070.08013.92
5.3.30.0170.10313.96
5.3.20.0030.08713.58
5.3.10.0100.07713.61
5.3.00.0030.08013.53
5.2.170.0030.10711.07
5.2.160.0070.13311.12
5.2.150.0000.14311.18
5.2.140.0100.13711.14
5.2.130.0170.12011.07
5.2.120.0100.13311.18
5.2.110.0070.14011.26
5.2.100.0070.08011.16
5.2.90.0100.13311.07
5.2.80.0000.11711.14
5.2.70.0030.10011.10
5.2.60.0070.13011.05
5.2.50.0030.14311.01
5.2.40.0070.13311.15
5.2.30.0030.10310.93
5.2.20.0070.14010.95
5.2.10.0100.13711.02
5.2.00.0000.10310.79
5.1.60.0030.10010.02
5.1.50.0070.0739.91
5.1.40.0030.09310.02
5.1.30.0100.07010.41
5.1.20.0030.11010.35
5.1.10.0030.07310.05
5.1.00.0100.11010.11
5.0.50.0000.1379.69
5.0.40.0030.1439.69
5.0.30.0100.1639.69
5.0.20.0030.1039.69
5.0.10.0070.1439.69
5.0.00.0000.1909.69
4.4.90.0070.0709.69
4.4.80.0030.0879.69
4.4.70.0030.0679.69
4.4.60.0000.0739.69
4.4.50.0030.0979.69
4.4.40.0000.1039.69
4.4.30.0070.0609.69
4.4.20.0000.0639.69
4.4.10.0000.0879.69
4.4.00.0030.0939.69
4.3.110.0000.0509.69
4.3.100.0030.0839.69
4.3.90.0070.0979.69
4.3.80.0030.0639.69
4.3.70.0030.0879.69
4.3.60.0000.0679.69
4.3.50.0070.0909.69
4.3.40.0030.0779.69
4.3.30.0000.1039.69
4.3.20.0000.0979.69
4.3.10.0000.1039.69
4.3.00.0000.0509.69

preferences:
37.87 ms | 401 KiB | 5 Q