3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(); for ($i = 0; $i < 10000; $i++) { $a[] = $i; } $start = microtime(true); foreach ($a as $k => $v) { $a[$k] = $v + 1; } echo "Completed in ", microtime(true) - $start, " Seconds\n"; $start = microtime(true); foreach ($a as $k => &$v) { $v = $v + 1; } echo "Completed in ", microtime(true) - $start, " Seconds\n"; $start = microtime(true); foreach ($a as $k => $v) {} echo "Completed in ", microtime(true) - $start, " Seconds\n"; $start = microtime(true); foreach ($a as $k => &$v) {} echo "Completed in ", microtime(true) - $start, " Seconds\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.00.0060.01316.02
7.3.120.0090.01115.65
7.3.110.0080.01015.79
7.3.100.0020.01515.73
7.3.90.0050.01015.65
7.3.80.0030.01615.86
7.3.70.0090.00615.57
7.3.60.0070.01015.51
7.3.50.0080.00715.63
7.3.40.0070.00915.56
7.3.30.0070.01015.67
7.3.20.0110.00716.63
7.3.10.0060.01116.71
7.3.00.0070.00916.75
7.2.250.0100.01115.61
7.2.240.0050.01715.86
7.2.230.0000.01715.86
7.2.220.0090.00315.92
7.2.210.0110.00615.97
7.2.200.0060.01015.79
7.2.190.0070.01316.02
7.2.180.0040.00915.81
7.2.170.0070.01116.06
7.2.160.0070.00715.69
7.2.150.0090.00916.91
7.2.140.0040.01117.01
7.2.130.0060.01316.66
7.2.120.0140.00317.03
7.2.110.0040.01216.95
7.2.100.0090.00916.95
7.2.90.0030.01316.75
7.2.80.0060.01317.04
7.2.70.0060.01217.10
7.2.60.0130.00617.05
7.2.50.0090.00617.09
7.2.40.0100.01016.86
7.2.30.0000.02016.88
7.2.20.0090.00916.85
7.2.10.0090.00916.95
7.2.00.0060.01118.12
7.1.330.0050.01015.69
7.1.320.0030.01115.85
7.1.310.0050.01415.89
7.1.300.0090.00815.79
7.1.290.0020.01615.83
7.1.280.0060.01215.62
7.1.270.0070.01015.80
7.1.260.0080.01015.87
7.1.250.0000.01515.69
7.1.70.0000.00817.10
7.1.60.0170.01019.61
7.1.50.0070.01717.13
7.1.00.0070.07322.40
7.0.200.0000.01416.64
7.0.140.0100.06722.00
7.0.60.0100.08720.79
7.0.50.0100.07718.54
7.0.40.0070.05020.08
7.0.30.0370.05020.12
7.0.20.0230.06720.16
7.0.10.0100.06320.16
7.0.00.0100.07019.99
5.6.280.0100.07723.65
5.6.210.0030.08323.29
5.6.200.0100.04020.76
5.6.190.0030.09323.23
5.6.180.0400.05323.32
5.6.170.0300.07323.23
5.6.160.0100.09323.22
5.6.150.0130.08320.97
5.6.140.0200.07320.99
5.6.130.0170.04320.95
5.6.120.0030.06323.64
5.6.110.0100.03723.95
5.6.100.0000.08723.85
5.6.90.0100.08723.94
5.6.80.0030.09323.34
5.5.350.0330.08023.24
5.5.340.0070.04720.70
5.5.330.0100.08722.96
5.5.320.0370.04022.89
5.5.310.0230.07322.98
5.5.300.0070.06720.80
5.5.290.0100.03720.70
5.5.280.0070.09323.71
5.5.270.0170.08323.77
5.5.260.0170.08323.68
5.5.250.0100.08723.61
5.5.240.0070.09322.99
5.4.450.0270.04722.13
5.4.440.0600.05322.02
5.4.430.0670.07322.22
5.4.420.0830.07021.94
5.4.410.0930.06022.20
5.4.400.0930.05721.92
5.4.390.1100.06021.70
5.4.380.0270.06321.29
5.4.370.0270.07021.47
5.4.360.0370.07321.46
5.4.350.0170.06321.47
5.4.340.0200.07021.39
5.4.320.0080.04415.29
5.4.310.0120.04415.29
5.4.300.0100.04415.29
5.4.290.0110.04615.29
5.4.280.0070.04315.18
5.4.270.0070.04715.19
5.4.260.0100.04715.19
5.4.250.0080.04815.19
5.4.240.0070.04715.19
5.4.230.0100.06015.18
5.4.220.0050.04715.18
5.4.210.0050.04615.18
5.4.200.0060.04315.18
5.4.190.0080.04215.18
5.4.180.0060.04415.18
5.4.170.0100.04415.18
5.4.160.0090.05115.18
5.4.150.0100.03915.18
5.4.140.0110.04414.86
5.4.130.0080.04214.85
5.4.120.0070.05114.81
5.4.110.0060.04014.80
5.4.100.0080.05114.80
5.4.90.0060.04614.81
5.4.80.0070.04114.80
5.4.70.0090.04214.80
5.4.60.0080.03814.80
5.4.50.0080.03914.80
5.4.40.0060.04214.79
5.4.30.0130.07714.79
5.4.20.0100.05814.79
5.4.10.0070.04014.79
5.4.00.0070.04214.27
5.3.290.0110.04415.51
5.3.280.0080.04315.45
5.3.270.0100.04315.46
5.3.260.0080.04315.45
5.3.250.0080.04115.45
5.3.240.0060.04415.45
5.3.230.0060.04515.45
5.3.220.0160.04115.41
5.3.210.0080.04715.49
5.3.200.0080.04415.41
5.3.190.0080.05115.41
5.3.180.0120.04215.41
5.3.170.0110.04015.41
5.3.160.0100.04315.41
5.3.150.0080.04215.41
5.3.140.0060.04415.40
5.3.130.0070.04315.39
5.3.120.0100.04015.39
5.3.110.0110.04015.39
5.3.100.0070.06014.88
5.3.90.0070.04514.87
5.3.80.0250.05214.86
5.3.70.0100.04814.86
5.3.60.0080.05314.84
5.3.50.0090.04014.79
5.3.40.0050.04314.79
5.3.30.0140.03414.75
5.3.20.0040.04414.53
5.3.10.0070.04214.49
5.3.00.0070.04114.48
5.2.170.0080.03311.71
5.2.160.0080.03311.71
5.2.150.0060.03811.71
5.2.140.0070.03611.71
5.2.130.0080.03611.67
5.2.120.0060.03411.67
5.2.110.0050.03711.68
5.2.100.0050.03511.67
5.2.90.0050.03611.67
5.2.80.0030.04011.67
5.2.70.0020.03911.67
5.2.60.0070.03711.62
5.2.50.0070.03911.59
5.2.40.0050.03811.56
5.2.30.0050.03811.54
5.2.20.0050.03811.53
5.2.10.0050.03511.68
5.2.00.0060.03611.32
5.1.60.0060.03011.50
5.1.50.0050.03211.49
5.1.40.0100.02911.47
5.1.30.0080.02911.82
5.1.20.0050.03411.84
5.1.10.0060.03211.57
5.1.00.0050.03211.57
5.0.50.0070.05110.05
5.0.40.0040.0419.91
5.0.30.0040.0569.73
5.0.20.0080.0479.70
5.0.10.0050.0399.68
5.0.00.0030.0589.68
4.4.90.0050.0134.78
4.4.80.0020.0154.75
4.4.70.0030.0154.76
4.4.60.0030.0154.75
4.4.50.0040.0144.77
4.4.40.0050.0264.71
4.4.30.0060.0234.76
4.4.20.0030.0194.85
4.4.10.0060.0194.85
4.4.00.0030.0354.76
4.3.110.0030.0234.67
4.3.100.0040.0154.66
4.3.90.0020.0194.63
4.3.80.0030.0344.59
4.3.70.0030.0224.63
4.3.60.0030.0144.63
4.3.50.0030.0154.63
4.3.40.0030.0244.53
4.3.30.0030.0163.29
4.3.20.0030.0233.27
4.3.10.0020.0203.23
4.3.00.0100.01313.57

preferences:
37.96 ms | 401 KiB | 5 Q