3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SomeObj { funcion doTest() {} } $someObj = new SomeObj; class SomeClass { static funcion 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)
5.4.260.0200.06718.96
5.4.250.0100.05018.83
5.4.240.0100.05018.75
5.4.230.0130.04718.97
5.4.220.0130.07018.94
5.4.210.0070.05318.77
5.4.200.0130.07719.01
5.4.190.0270.06019.00
5.4.180.0100.05318.77
5.4.170.0070.05318.75
5.4.160.0070.05318.96
5.4.150.0070.05318.96
5.4.140.0070.05316.38
5.4.130.0070.04716.37
5.4.120.0100.05016.34
5.4.110.0030.05316.38
5.4.100.0070.05016.38
5.4.90.0070.04716.64
5.4.80.0130.04316.59
5.4.70.0100.05716.38
5.4.60.0200.05016.29
5.4.50.0000.05316.58
5.4.40.0130.05016.52
5.4.30.0070.04716.35
5.4.20.0100.05316.61
5.4.10.0130.05016.38
5.4.00.0100.06016.03
5.3.280.0130.06014.49
5.3.270.0070.05714.69
5.3.260.0030.05714.67
5.3.250.0070.05314.82
5.3.240.0100.05314.82
5.3.230.0130.05014.73
5.3.220.0070.05314.41
5.3.210.0130.04714.55
5.3.200.0030.05314.39
5.3.190.0030.05314.47
5.3.180.0100.04714.62
5.3.170.0030.05714.63
5.3.160.0070.05314.54
5.3.150.0030.05314.63
5.3.140.0030.05714.71
5.3.130.0230.03714.63
5.3.120.0070.07714.62
5.3.110.0130.04714.37
5.3.100.0100.05014.17
5.3.90.0130.04314.17
5.3.80.0100.04713.99
5.3.70.0070.06314.04
5.3.60.0130.04314.08
5.3.50.0070.05313.93
5.3.40.0100.07314.04
5.3.30.0200.05013.89
5.3.20.0100.04313.70
5.3.10.0070.05013.81
5.3.00.0130.04713.70
5.2.170.0070.04711.09
5.2.160.0030.04711.12
5.2.150.0030.04311.12
5.2.140.0100.03711.29
5.2.130.0100.03310.92
5.2.120.0200.02311.16
5.2.110.0070.03711.17
5.2.100.0000.04311.16
5.2.90.0070.05311.08
5.2.80.0030.04311.15
5.2.70.0070.04011.16
5.2.60.0030.04011.02
5.2.50.0100.05310.94
5.2.40.0100.03711.21
5.2.30.0030.06310.95
5.2.20.0070.05311.03
5.2.10.0030.04010.94
5.2.00.0030.04010.80
5.1.60.0070.04010.06
5.1.50.0030.03710.08
5.1.40.0030.03710.17
5.1.30.0170.04010.41
5.1.20.0070.03310.42
5.1.10.0130.04310.11
5.1.00.0100.03010.26
5.0.50.0030.0408.59
5.0.40.0030.0278.24
5.0.30.0100.0408.16
5.0.20.0130.0178.14
5.0.10.0070.0378.39
5.0.00.0070.0478.20
4.4.90.0000.0277.05
4.4.80.0000.0237.05
4.4.70.0000.0237.05
4.4.60.0030.0237.05
4.4.50.0030.0307.05
4.4.40.0030.0337.05
4.4.30.0000.0277.05
4.4.20.0030.0277.05
4.4.10.0000.0237.05
4.4.00.0070.0407.05
4.3.110.0030.0237.05
4.3.100.0030.0207.05
4.3.90.0000.0277.05
4.3.80.0070.0377.05
4.3.70.0000.0237.05
4.3.60.0030.0307.05
4.3.50.0070.0177.05
4.3.40.0070.0337.05
4.3.30.0000.0237.05
4.3.20.0000.0237.05
4.3.10.0000.0277.05
4.3.00.0170.0207.32

preferences:
142.19 ms | 1394 KiB | 7 Q