3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SomeObj { public function doTest() {} } $someObj = new SomeObj; class SomeClass { public static function doTest() {;} } function something_doTest() {} // bench static method $starttime = microtime(true); for ($i = 0; $i< 10*1000*1000; $i++) SomeClass::doTest($i); echo "Static Time: " , (microtime(true)-$starttime) , " ms\n"; // bench object method $starttime = microtime(true); for ($i = 0; $i< 10*1000*1000; $i++) $someObj->doTest($i); echo "Object Time: " , (microtime(true)-$starttime) , " ms\n"; // bench function $starttime = microtime(true); for ($i = 0; $i< 10*1000*1000; $i++) something_doTest($i); echo "Function Time: " , (microtime(true)-$starttime) , " ms\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.0030.83519.50
7.1.70.0070.99417.31
7.1.60.0070.93016.94
7.1.50.0070.88717.03
7.1.00.0030.88722.30
7.0.200.0030.94616.80
7.0.140.0030.91722.00
7.0.60.0030.87320.05
7.0.50.0100.94317.89
7.0.40.0130.98720.11
7.0.30.0330.93720.23
7.0.20.0370.93320.09
7.0.10.0030.91720.25
7.0.00.0100.93320.16
5.6.280.0032.33321.13
5.6.210.0102.29020.70
5.6.200.0132.26318.21
5.6.190.0102.24720.33
5.6.180.0432.28320.63
5.6.170.0302.23320.50
5.6.160.0072.37020.57
5.6.150.0132.33018.15
5.6.140.0072.33318.14
5.6.130.0202.25718.26
5.6.120.0102.38020.77
5.6.110.0072.25721.00
5.6.100.0032.26321.02
5.6.90.0132.28020.97
5.6.80.0132.33720.54
5.5.350.0272.09020.31
5.5.340.0072.21718.02
5.5.330.0032.24020.13
5.5.320.0532.31020.29
5.5.310.0302.41020.89
5.5.300.0072.21718.07
5.5.290.0132.31018.03
5.5.280.0072.26320.75
5.5.270.0002.31020.77
5.5.260.0032.20020.69
5.5.250.0032.25720.72
5.5.240.0172.08020.29
5.4.450.0932.23019.47
5.4.440.0472.42019.46
5.4.430.0102.40019.38
5.4.420.0072.44019.29
5.4.410.0202.43719.28
5.4.400.0932.40018.87
5.4.390.0032.43719.11
5.4.380.0572.18018.52
5.4.370.0432.43318.73
5.4.360.0132.42019.04
5.4.350.0402.46018.54
5.4.340.0502.42318.55
5.4.320.0102.44018.89
5.4.310.0191.98512.51
5.4.300.0091.99012.51
5.4.290.0232.41019.07
5.4.280.0101.99012.41
5.4.270.0091.99312.41
5.4.260.0102.45718.61
5.4.250.0172.41319.02
5.4.240.0132.42318.85
5.4.230.0232.40318.85
5.4.220.0132.41718.72
5.4.210.0032.47719.04
5.4.200.0202.40718.81
5.4.190.0172.42718.86
5.4.180.0332.37018.87
5.4.170.0032.43318.74
5.4.160.0232.42318.83
5.4.150.0302.41719.02
5.4.140.0332.43016.57
5.4.130.0102.41716.42
5.4.120.0172.39716.29
5.4.110.0212.40916.49
5.4.100.0172.21716.39
5.4.90.0172.44316.34
5.4.80.0102.43716.29
5.4.70.0102.44016.38
5.4.60.0132.42016.50
5.4.50.0032.45016.49
5.4.40.0002.18016.48
5.4.30.0102.40316.49
5.4.20.0132.35316.36
5.4.10.0432.39016.49
5.4.00.0302.36315.90
5.3.290.0202.42714.49
5.3.280.0102.39714.45
5.3.270.0172.40014.45
5.3.260.0272.41314.60
5.3.250.0202.42714.43
5.3.240.0132.43314.45
5.3.230.0132.42314.43
5.3.220.0072.40314.51
5.3.210.0202.39014.41
5.3.200.0202.04714.24
5.3.190.0332.40314.43
5.3.180.0132.33714.48
5.3.170.0232.41714.45
5.3.160.0302.45014.47
5.3.150.0232.34714.58
5.3.140.0172.17314.49
5.3.130.0232.43314.41
5.3.120.0102.44714.41
5.3.110.0302.43714.37
5.3.100.0102.41313.98
5.3.90.0072.42013.84
5.3.80.0102.40313.90
5.3.70.0532.33013.81
5.3.60.0272.41013.80
5.3.50.0272.41013.72
5.3.40.0102.38713.70
5.3.30.0232.41713.68
5.3.20.0102.45713.58
5.3.10.0102.36013.25
5.3.00.0102.43313.45
5.2.170.0272.42310.89
5.2.160.0332.36310.84
5.2.150.0072.46710.93
5.2.140.0032.43710.83
5.2.130.0172.38710.76
5.2.120.0132.43710.90
5.2.110.0132.45310.88
5.2.100.0072.47311.02
5.2.90.0102.42310.90
5.2.80.0072.38711.04
5.2.70.0132.42711.00
5.2.60.0202.45710.88
5.2.50.0102.44710.93
5.2.40.0272.45710.82
5.2.30.0002.42710.90
5.2.20.0072.45710.87
5.2.10.0072.48010.69
5.2.00.0132.42010.59
5.1.60.0202.4339.77
5.1.50.0232.4179.87
5.1.40.0102.4479.86
5.1.30.0072.44710.25
5.1.20.0202.43010.11
5.1.10.0232.4439.76
5.1.00.0132.3979.91
5.0.50.0202.4438.45
5.0.40.0132.4238.20
5.0.30.0132.4608.06
5.0.20.0232.4337.96
5.0.10.0032.4207.98
5.0.00.0172.4607.99
4.4.90.0030.0207.07
4.4.80.0070.0177.07
4.4.70.0030.0237.07
4.4.60.0000.0277.07
4.4.50.0030.0237.07
4.4.40.0030.0307.07
4.4.30.0000.0237.07
4.4.20.0100.0177.07
4.4.10.0100.0237.07
4.4.00.0030.0377.07
4.3.110.0070.0207.07
4.3.100.0100.0207.07
4.3.90.0030.0277.07
4.3.80.0000.0377.07
4.3.70.0070.0237.07
4.3.60.0000.0307.07
4.3.50.0000.0237.07
4.3.40.0070.0307.07
4.3.30.0030.0277.07
4.3.20.0030.0207.07
4.3.10.0000.0237.07
4.3.00.0000.02314.49

preferences:
36.38 ms | 401 KiB | 5 Q