3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { $foo = array(); for($x = 0; $x < 10000; $x++){ $foo[] = rand(); } return $foo; } $t = microtime(true); for($x=0;$x<100; $x++){ foreach(foo() as $val){ $val = $val + 2; } } echo round(microtime(true) - $t, 5)."\n"; $t = microtime(true); for($x=0;$x<100; $x++){ $foo = foo(); foreach($foo as $val){ $val = $val + 2; } } echo round(microtime(true) - $t, 5)."\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.4.10.0070.14615.86
7.4.00.0130.14015.81
7.3.130.0030.12115.48
7.3.120.0030.15715.64
7.3.110.0130.14815.67
7.3.100.0030.10715.64
7.3.90.0070.11615.75
7.3.80.0070.10915.59
7.3.70.0100.10015.67
7.3.60.0030.12015.85
7.3.50.0030.10215.60
7.3.40.0100.10415.71
7.3.30.0070.10415.61
7.3.20.0030.11616.60
7.3.10.0120.10616.64
7.3.00.0070.11416.73
7.2.260.0130.15315.86
7.2.250.0130.14915.97
7.2.240.0070.11816.05
7.2.230.0030.14515.97
7.2.220.0130.14915.97
7.2.210.0100.10515.96
7.2.200.0070.11415.77
7.2.190.0000.10815.69
7.2.180.0030.12315.90
7.2.170.0070.12015.79
7.2.160.0000.11216.01
7.2.150.0000.11217.06
7.2.140.0000.11117.06
7.2.130.0100.12916.96
7.2.120.0100.10916.96
7.2.110.0050.15916.89
7.2.100.0030.12917.02
7.2.90.0100.11016.81
7.2.80.0100.12116.92
7.2.70.0070.13417.00
7.2.60.0070.11717.07
7.2.50.0070.14416.99
7.2.40.0050.11916.91
7.2.30.0050.10716.98
7.2.20.0030.14316.79
7.2.10.0050.11017.09
7.2.00.0030.11217.84
7.1.330.0100.23915.92
7.1.320.0000.24515.93
7.1.310.0070.22915.82
7.1.300.0100.23815.79
7.1.290.0100.22515.56
7.1.280.0030.24015.58
7.1.270.0070.25815.77
7.1.260.0070.22215.71
7.1.250.0020.27915.83
7.1.240.0030.29615.67
7.1.230.0030.22715.86
7.1.220.0070.22915.84
7.1.210.0030.29415.82
7.1.200.0000.23915.71
7.1.190.0000.27515.49
7.1.180.0030.24215.78
7.1.170.0070.30215.92
7.1.160.0030.22915.47
7.1.150.0070.24015.87
7.1.140.0030.24915.77
7.1.130.0030.23015.76
7.1.120.0070.30915.92
7.1.110.0000.30815.86
7.1.100.0030.22515.53
7.1.90.0070.22615.77
7.1.80.0000.24415.78
7.1.70.0020.16416.33
7.1.60.0070.21917.54
7.1.50.0080.19916.42
7.1.40.0070.24715.59
7.1.30.0070.23015.57
7.1.20.0100.22715.86
7.1.10.0000.24315.82
7.1.00.0070.27515.54
7.0.330.0030.27915.36
7.0.320.0070.29515.37
7.0.310.0100.25715.38
7.0.300.0000.25715.37
7.0.290.0030.27915.48
7.0.280.0030.24615.44
7.0.270.0030.27615.55
7.0.260.0070.34815.14
7.0.250.0030.35415.39
7.0.240.0070.31015.24
7.0.230.0030.32115.43
7.0.220.0000.25615.29
7.0.210.0070.28515.37
7.0.200.0100.18215.67
7.0.190.0030.26715.35
7.0.180.0070.29015.49
7.0.170.0030.27115.36
7.0.160.0070.32115.38
7.0.150.0070.24015.45
7.0.140.0070.26915.11
7.0.130.0000.32615.54
7.0.120.0000.30115.55
7.0.110.0000.25915.32
7.0.100.0030.30115.51
7.0.90.0070.26215.57
7.0.80.0030.35015.43
7.0.70.0030.31315.17
7.0.60.0100.29315.44
7.0.50.0030.29915.51
7.0.40.0000.25913.42
7.0.30.0000.26113.41
7.0.20.0000.36513.60
7.0.10.0070.26313.26
7.0.00.0070.30813.47
5.6.400.0370.73217.21
5.6.390.0230.83717.71
5.6.380.0270.70317.55
5.6.370.0370.81217.71
5.6.360.0230.69817.39
5.6.350.0370.77217.64
5.6.340.0270.74817.66
5.6.330.0200.73617.64
5.6.320.0400.74517.64
5.6.310.0230.79317.70
5.6.300.0200.79517.10
5.6.290.0270.75117.58
5.6.280.0420.88017.33
5.6.270.0400.82717.19
5.6.260.0330.80517.64
5.6.250.0170.85217.73
5.6.240.0230.78517.54
5.6.230.0530.76617.46
5.6.220.0500.75917.33
5.6.210.0370.91617.38
5.6.200.0400.81717.48
5.6.190.0300.78017.54
5.6.180.0630.91417.37
5.6.170.0370.90417.51
5.6.160.0260.80817.47
5.6.150.0300.79917.50
5.6.140.0400.70717.50
5.6.130.0370.89717.53
5.6.120.0330.92217.29
5.6.110.0430.74617.54
5.6.100.0300.98217.55
5.6.90.0470.94517.62
5.6.80.0300.81817.67
5.6.70.0560.87817.68
5.6.60.0430.94317.30
5.6.50.0400.87817.15
5.6.40.0360.74717.20
5.6.30.0260.82417.39
5.6.20.0300.74717.43
5.6.10.0300.85917.46
5.6.00.0430.72117.12
5.5.380.0330.82917.13
5.5.370.0370.77117.27
5.5.360.0430.80717.41
5.5.350.0270.89717.20
5.5.340.0330.89017.43
5.5.330.0230.88617.56
5.5.320.0430.74017.49
5.5.310.0330.87117.33
5.5.300.0330.93717.59
5.5.290.0430.85217.63
5.5.280.0460.83117.62
5.5.270.0400.78917.34
5.5.260.0330.77617.57
5.5.250.0470.91917.07
5.5.240.0530.94817.56
5.5.230.0360.84317.15
5.5.220.0301.00217.54
5.5.210.0430.89217.00
5.5.200.0430.93917.23
5.5.190.0270.89317.28
5.5.180.0670.86217.17
5.5.170.0430.78517.24
5.5.160.0430.95917.24
5.5.150.0470.91117.16
5.5.140.0470.95117.61
5.5.130.0470.83717.52
5.5.120.0500.96717.41
5.5.110.0760.93217.50
5.5.100.0360.77917.53
5.5.90.0400.92117.39
5.5.80.0500.86517.38
5.5.70.0530.95817.40
5.5.60.0370.97317.01
5.5.50.0530.90517.43
5.5.40.0370.72117.64
5.5.30.0570.92617.16
5.5.20.0460.91117.30
5.5.10.0360.78517.43
5.5.00.0330.91517.51
5.4.450.0300.96814.19
5.4.440.0330.76414.22
5.4.430.0331.00913.89
5.4.420.0331.00914.32
5.4.410.0270.83613.76
5.4.400.0300.75814.07
5.4.390.0430.83214.05
5.4.380.0300.81614.21
5.4.370.0370.81414.30
5.4.360.0330.85214.05
5.4.350.0360.93514.11
5.4.340.0500.95714.13
5.4.330.0370.98714.02
5.4.320.0500.97013.91
5.4.310.0400.98314.09
5.4.300.0270.81613.91
5.4.290.0430.85514.01
5.4.280.0331.00514.04
5.4.270.0270.91414.32
5.4.260.0430.99114.28
5.4.250.0300.79113.97
5.4.240.0360.81514.12
5.4.230.0330.98613.98
5.4.220.0500.90114.12
5.4.210.0400.94114.30
5.4.200.0430.92714.26
5.4.190.0230.93414.27
5.4.180.0300.87413.84
5.4.170.0230.98914.38
5.4.160.0400.86313.93
5.4.150.0330.90213.91
5.4.140.0500.95814.01
5.4.130.0660.90613.95
5.4.120.0470.94914.00
5.4.110.0330.95614.13
5.4.100.0401.00913.93
5.4.90.0500.82213.75
5.4.80.0360.94314.36
5.4.70.0530.80213.88
5.4.60.0270.88214.10
5.4.50.0430.85614.06
5.4.40.0300.74714.31
5.4.30.0370.92714.17
5.4.20.0330.90514.19
5.4.10.0300.85914.23
5.4.00.0500.90613.98
5.3.290.0000.92613.44
5.3.280.0070.94013.03
5.3.270.0030.93013.08
5.3.260.0001.01813.38
5.3.250.0031.00013.38
5.3.240.0031.11513.18
5.3.230.0071.10913.09
5.3.220.0121.00813.15
5.3.210.0031.14913.16
5.3.200.0101.04913.25
5.3.190.0031.12713.34
5.3.180.0030.94413.48
5.3.170.0001.11513.48
5.3.160.0031.02913.48
5.3.150.0001.14713.16
5.3.140.0030.93213.36
5.3.130.0031.09713.32
5.3.120.0070.93113.38
5.3.110.0001.17813.09
5.3.100.0001.05413.36
5.3.90.0071.11513.33
5.3.80.0071.01713.18
5.3.70.0000.92312.75
5.3.60.0071.14312.97
5.3.50.0001.15313.18
5.3.40.0030.96613.13
5.3.30.0000.97913.26
5.3.20.0000.96813.09
5.3.10.0000.88012.89
5.3.00.0070.98812.80

preferences:
39.24 ms | 401 KiB | 5 Q