3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo {} function f0($foo) {} function f1(Foo $foo) {} function f2(Foo $foo = null) {} $times = array(); for ($j = 0; $j < 10; $j++) { $start = microtime(true); for ($i = 0; $i < 1000000; $i++) { f0(new Foo()); } $times[] = microtime(true) - $start; } var_dump(array_sum($times) / 10); $times = array(); for ($j = 0; $j < 10; $j++) { $start = microtime(true); for ($i = 0; $i < 1000000; $i++) { f1(new Foo()); } $times[] = microtime(true) - $start; } var_dump(array_sum($times) / 10); $times = array(); for ($j = 0; $j < 10; $j++) { $start = microtime(true); for ($i = 0; $i < 1000000; $i++) { f2(new Foo()); } $times[] = microtime(true) - $start; } var_dump(array_sum($times) / 10);

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.0.120.0032.29322.16
7.0.110.0002.50021.98
7.0.100.0032.35721.95
7.0.90.0032.49722.10
7.0.80.0072.20022.06
7.0.70.0072.21322.01
7.0.60.0002.27022.17
7.0.50.0032.18322.19
7.0.40.0032.19022.20
7.0.30.0002.22722.10
7.0.20.0032.27322.07
7.0.10.0032.36722.03
7.0.00.0032.18022.05
5.6.260.0072.49320.88
5.6.250.0002.50021.13
5.6.240.0032.49721.01
5.6.230.0032.49721.01
5.6.220.0032.49721.07
5.6.210.0102.49020.96
5.6.200.0072.49321.09
5.6.190.0032.49721.01
5.6.180.0072.49320.75
5.6.170.0072.49320.93
5.6.160.0072.49320.95
5.6.150.0072.49321.05
5.6.140.0032.49721.01
5.6.130.0032.49721.06
5.6.120.0032.49720.93
5.6.110.0072.49321.05
5.6.100.0072.49321.05
5.6.90.0072.49321.03
5.6.80.0002.50020.47
5.6.70.0072.49320.41
5.6.60.0032.49720.30
5.6.50.0072.49320.46
5.6.40.0032.49720.20
5.6.30.0032.49720.20
5.6.20.0032.49720.11
5.6.10.0072.49320.45
5.6.00.0032.49720.19
5.5.380.0002.50017.56
5.5.370.0032.49717.54
5.5.360.0002.50017.45
5.5.350.0032.49717.55
5.5.340.0002.50018.07
5.5.330.0032.49717.95
5.5.320.0002.50018.09
5.5.310.0032.49718.14
5.5.300.0072.49317.91
5.5.290.0032.49717.94
5.5.280.0002.50017.95
5.5.270.0072.49318.05
5.5.260.0072.49318.10
5.5.250.0032.49717.83
5.5.240.0072.49317.29
5.5.230.0102.49017.30
5.5.220.0072.49317.21
5.5.210.0032.49717.43
5.5.200.0002.50017.21
5.5.190.0072.49317.49
5.5.180.0002.50017.30
5.5.160.0032.49717.30
5.5.150.0032.49717.27
5.5.140.0002.50017.24
5.5.130.0032.49717.24
5.5.120.0032.49717.17
5.5.110.0072.49317.30
5.5.100.0032.49717.21
5.5.90.0032.49717.17
5.5.80.0032.49717.16
5.5.70.0072.49317.33
5.5.60.0102.49017.33
5.5.50.0002.50017.29
5.5.40.0032.49717.19
5.5.30.0002.50017.37
5.5.20.0072.49317.16
5.5.10.0002.50017.29
5.5.00.0032.49717.35
5.4.450.0032.49719.27
5.4.440.0032.49719.45
5.4.430.0002.50019.25
5.4.420.0002.50019.23
5.4.410.0072.49319.34
5.4.400.0032.49719.02
5.4.390.0002.50019.01
5.4.380.0032.49719.04
5.4.370.0002.50018.91
5.4.360.0002.50019.01
5.4.350.0002.50019.29
5.4.340.0072.49318.91
5.4.320.0032.49718.92
5.4.310.0002.50019.20
5.4.300.0032.49719.27
5.4.290.0032.49719.03
5.4.280.0032.49718.98
5.4.270.0072.49318.96
5.4.260.0032.49719.27
5.4.250.0002.50018.85
5.4.240.0072.49318.93
5.4.230.0032.49718.94
5.4.220.0032.49718.92
5.4.210.0002.50019.01
5.4.200.0072.49319.11
5.4.190.0032.49718.91
5.4.180.0032.49718.91
5.4.170.0032.49719.23
5.4.160.0002.50018.95
5.4.150.0102.49019.17
5.4.140.0032.49716.25
5.4.130.0002.50016.42
5.4.120.0032.49716.51
5.4.110.0032.49716.29
5.4.100.0072.49316.33
5.4.90.0002.50016.45
5.4.80.0032.49716.44
5.4.70.0072.49316.28
5.4.60.0102.49016.60
5.4.50.0032.49716.45
5.4.40.0002.50016.39
5.4.30.0032.49716.43
5.4.20.0032.49716.43
5.4.10.0032.49716.45
5.4.00.0032.49715.81
5.3.290.0002.50014.51
5.3.280.0072.49314.46
5.3.270.0072.49314.62
5.3.260.0032.49714.30
5.3.250.0032.49714.48
5.3.240.0002.50014.55
5.3.230.0032.49714.54
5.3.220.0102.49014.44
5.3.210.0002.50014.28
5.3.200.0002.50014.48
5.3.190.0032.49714.58
5.3.180.0032.49714.49
5.3.170.0032.49714.43
5.3.160.0032.49714.43
5.3.150.0032.49714.32
5.3.140.0072.49314.50
5.3.130.0002.50014.39
5.3.120.0032.49714.39
5.3.110.0032.49714.40
5.3.100.0072.49313.97
5.3.90.0002.50013.94
5.3.80.0032.49713.79
5.3.70.0072.48713.79
5.3.60.0072.49313.80
5.3.50.0102.48313.75
5.3.40.0072.49313.81
5.3.30.0032.49713.70
5.3.20.0032.49713.56
5.3.10.0032.49713.44
5.3.00.0102.49013.50
5.2.170.0072.49311.07
5.2.160.0002.50011.16
5.2.150.0002.50011.00
5.2.140.0072.49310.76
5.2.130.0032.49710.88
5.2.120.0002.50010.96
5.2.110.0072.48710.84
5.2.100.0072.49310.88
5.2.90.0072.49310.88
5.2.80.0032.49710.87
5.2.70.0032.49010.71
5.2.60.0032.49710.81
5.2.50.0102.49010.80
5.2.40.0032.49710.74
5.2.30.0032.49710.74
5.2.20.0072.49310.80
5.2.10.0002.50010.77
5.2.00.0002.50010.53
5.1.60.0002.5009.90
5.1.50.0072.4939.81
5.1.40.0072.49310.06
5.1.30.0002.50010.20
5.1.20.0032.49710.09
5.1.10.0002.5009.90
5.1.00.0032.49710.00
5.0.50.0072.4938.59
5.0.40.0032.4978.59
5.0.30.0002.5008.59
5.0.20.0072.4938.59
5.0.10.0032.4978.59
5.0.00.0072.4938.59
4.4.90.0000.0308.59
4.4.80.0000.0278.59
4.4.70.0000.0338.59
4.4.60.0000.0308.59
4.4.50.0000.0308.59
4.4.40.0030.0438.59
4.4.30.0070.0238.59
4.4.20.0030.0278.59
4.4.10.0070.0238.59
4.4.00.0030.0438.59
4.3.110.0000.0338.59
4.3.100.0000.0308.59
4.3.90.0000.0238.59
4.3.80.0000.0478.59
4.3.70.0000.0308.59
4.3.60.0000.0308.59
4.3.50.0000.0338.59
4.3.40.0000.0478.59
4.3.30.0000.0338.59
4.3.20.0030.0308.59
4.3.10.0000.0338.59
4.3.00.0030.0238.59

preferences:
38.4 ms | 400 KiB | 5 Q