3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testBase = array_fill(0, 100000, 'testdata'); echo "Test array count: " . count($testBase) . PHP_EOL; for($x = 0; $x < 10; $x++ ) { echo "Test #$x" . PHP_EOL; /* foreach test */ $testCopy = array(); $before = microtime(true); foreach ($testBase as $key => $value) { $testCopy[$key] = $value . 'asdasd'; } $after = microtime(true); $dif = $after - $before; echo "foreach test ($before, $after): $dif" . PHP_EOL; /* array_walk test */ $testCopy = $testBase; $before2 = microtime(true); array_walk($testCopy, function(&$value, $key) { $value = $value . 'qweqwe'; }); $after2 = microtime(true); $dif2 = $after2 - $before2; echo "array_walk test ($before2, $after2): $dif2" . PHP_EOL; }

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.0140.16235.50
7.1.70.0070.14633.29
7.1.60.0100.19633.33
7.1.50.0170.20633.30
7.1.00.0230.24738.21
7.0.200.4500.18730.87
7.0.140.0170.24036.04
7.0.70.0600.21034.24
7.0.60.0430.22734.33
7.0.50.0400.27334.66
7.0.40.0370.21327.06
7.0.30.0430.22326.96
7.0.20.0500.25026.87
7.0.10.0270.24027.06
7.0.00.0530.22727.02
5.6.280.0230.68047.97
5.6.220.0500.66047.66
5.6.210.0230.63047.54
5.6.200.0130.56748.11
5.6.190.0170.69048.11
5.6.180.0370.70748.03
5.6.170.0100.66748.03
5.6.160.0230.67048.04
5.6.150.0270.70748.13
5.6.140.0230.69348.18
5.6.130.0200.68348.04
5.6.120.0130.49748.08
5.6.110.0200.54348.09
5.6.100.0070.53048.09
5.6.90.0530.51348.08
5.6.80.0000.55347.54
5.6.70.0300.69047.40
5.6.60.0270.69747.46
5.6.50.0270.62047.63
5.6.40.0170.53747.37
5.6.30.0130.62347.48
5.6.20.0170.58047.44
5.6.10.0130.62047.32
5.6.00.0230.69047.36
5.5.360.0200.70047.53
5.5.350.0270.64347.50
5.5.340.0200.65047.82
5.5.330.0270.63347.88
5.5.320.0230.64047.98
5.5.310.0200.63347.93
5.5.300.0230.66347.84
5.5.290.0370.63347.84
5.5.280.0230.68747.72
5.5.270.0070.71747.91
5.5.260.0100.50747.80
5.5.250.0130.59347.80
5.5.240.1030.67347.23
5.5.230.0200.67347.22
5.5.220.0300.60747.32
5.5.210.0230.66747.23
5.5.200.0170.64047.31
5.5.190.0330.71347.32
5.5.180.0200.50347.21
5.5.160.0200.66047.07
5.5.150.0230.62347.33
5.5.140.0200.68047.33
5.5.130.0230.60747.25
5.5.120.0170.68347.26
5.5.110.0330.60347.34
5.5.100.0600.54747.15
5.5.90.0070.53347.13
5.5.80.0230.65347.20
5.5.70.0170.64747.04
5.5.60.0200.65347.14
5.5.50.0200.69747.24
5.5.40.0270.66047.20
5.5.30.0230.64047.23
5.5.20.0230.68347.13
5.5.10.0270.66347.06
5.5.00.0400.63747.05
5.4.450.0170.66046.24
5.4.440.0270.53046.38
5.4.430.0070.54346.29
5.4.420.0100.57746.43
5.4.410.0370.51046.10
5.4.400.0200.65345.91
5.4.390.0200.65346.01
5.4.380.0270.66046.07
5.4.370.0600.55346.11
5.4.360.0230.64746.22
5.4.350.0270.53745.87
5.4.340.0370.70745.87
5.4.320.0370.62346.05
5.4.310.0270.61046.23
5.4.300.0170.63046.04
5.4.290.0100.65746.12
5.4.280.0770.68746.06
5.4.270.0030.61746.04
5.4.260.0270.67346.19
5.4.250.0270.59746.03
5.4.240.0170.70746.05
5.4.230.0300.66046.06
5.4.220.0330.65745.96
5.4.210.0200.64346.20
5.4.200.0230.65745.96
5.4.190.0170.67345.89
5.4.180.0230.65346.04
5.4.170.0330.64046.10
5.4.160.0200.70346.04
5.4.150.0130.64045.89
5.4.140.0130.66343.43
5.4.130.0170.67343.21
5.4.120.0130.62043.25
5.4.110.0300.60043.36
5.4.100.0300.58743.35
5.4.90.0170.51043.46
5.4.80.0100.62043.33
5.4.70.0030.50743.35
5.4.60.0700.61743.41
5.4.50.0200.63743.45
5.4.40.0230.63743.32
5.4.30.0070.64743.53
5.4.20.0330.70043.47
5.4.10.0330.65043.53
5.4.00.0300.65342.84
5.3.290.0200.72741.18
5.3.280.0030.78041.18
5.3.270.0100.75041.18
5.3.260.0500.74041.16
5.3.250.0270.76341.13
5.3.240.0130.80041.07
5.3.230.0130.80341.04
5.3.220.0170.79341.05
5.3.210.0130.71041.02
5.3.200.0030.63741.11
5.3.190.0100.64041.05
5.3.180.0070.67341.03
5.3.170.0070.65341.25
5.3.160.0170.65041.25
5.3.150.0200.69041.16
5.3.140.0100.65741.16
5.3.130.0130.74341.03
5.3.120.0130.76341.07
5.3.110.0230.77041.18
5.3.100.0170.73741.09
5.3.90.0000.76341.18
5.3.80.0170.64040.83
5.3.70.0130.63041.15
5.3.60.0200.59741.04
5.3.50.0070.77041.03
5.3.40.0200.73041.03
5.3.30.0070.60740.88
5.3.20.0200.72040.61
5.3.10.0100.79040.58
5.3.00.0100.76340.61
5.2.170.0000.04311.20
5.2.160.0030.06311.01
5.2.150.0070.06311.13
5.2.140.0000.04310.96
5.2.130.0070.03710.94
5.2.120.0100.03011.09
5.2.110.0030.06310.96
5.2.100.0070.02011.02
5.2.90.0000.05311.10
5.2.80.0000.07011.04
5.2.70.0070.03711.14
5.2.60.0000.06711.05
5.2.50.0000.05310.88
5.2.40.0070.05711.03
5.2.30.0030.06010.97
5.2.20.0030.04710.95
5.2.10.0030.05010.92
5.2.00.0070.04010.77
5.1.60.0000.04710.51
5.1.50.0130.03710.51
5.1.40.0030.04710.51
5.1.30.0130.05310.51
5.1.20.0070.04710.51
5.1.10.0030.04310.51
5.1.00.0000.06310.51
5.0.50.0030.04010.51
5.0.40.0030.03310.51
5.0.30.0000.05310.51
5.0.20.0030.04310.51
5.0.10.0030.03010.51
5.0.00.0100.05310.51
4.4.90.0030.02010.51
4.4.80.0030.03010.51
4.4.70.0000.02310.51
4.4.60.0000.03710.51
4.4.50.0000.03010.51
4.4.40.0070.03310.51
4.4.30.0000.02710.51
4.4.20.0030.03310.51
4.4.10.0070.02710.51
4.4.00.0000.04710.51
4.3.110.0070.03010.51
4.3.100.0030.02010.51
4.3.90.0000.03710.51
4.3.80.0000.02710.51
4.3.70.0000.03310.51
4.3.60.0000.03010.51
4.3.50.0030.03310.51
4.3.40.0000.02310.51
4.3.30.0030.01310.51
4.3.20.0000.01710.51
4.3.10.0070.02310.51
4.3.00.0000.03710.51

preferences:
34.58 ms | 400 KiB | 5 Q