3v4l.org

run code in 300+ PHP versions simultaneously
<?php function removeSomeElements($arr) { for ($i = 0; $i<count($arr); $i++) { $c = $arr[$i]; if ($c > 2) { echo "Element $c found at $i\n"; unset($arr[$i]); } } print_r($arr); // misses middle element return $arr; } $t = [0, 3, 1]; print_r($t); // original array $t = removeSomeElements($t); print_r($t); // should be missing middle element, but everything is here

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)
8.3.70.0110.00416.63
8.3.60.0100.00718.25
8.3.50.0120.00816.52
8.3.40.0040.01118.55
8.3.30.0060.00918.71
8.3.20.0030.00619.01
8.3.10.0000.00821.01
8.3.00.0040.00423.61
8.2.190.0170.00316.58
8.2.180.0040.01116.75
8.2.170.0090.00922.96
8.2.160.0070.00720.10
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00819.83
8.2.120.0050.00326.35
8.2.110.0060.00320.43
8.2.100.0090.00317.91
8.2.90.0040.00418.03
8.2.80.0080.00017.97
8.2.70.0040.00418.05
8.2.60.0000.00818.05
8.2.50.0030.00618.10
8.2.40.0000.00719.48
8.2.30.0030.00319.54
8.2.20.0000.00718.11
8.2.10.0090.00019.78
8.2.00.0000.00719.36
8.1.280.0030.01325.92
8.1.270.0030.00522.06
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0030.00623.89
8.1.230.0080.00419.07
8.1.220.0040.00417.77
8.1.210.0050.00318.95
8.1.200.0030.00617.35
8.1.190.0000.00817.10
8.1.180.0040.00418.10
8.1.170.0030.00618.70
8.1.160.0070.00018.83
8.1.150.0040.00418.95
8.1.140.0050.00317.57
8.1.130.0030.00618.88
8.1.120.0000.00817.32
8.1.110.0040.00417.42
8.1.100.0050.00317.44
8.1.90.0030.00617.46
8.1.80.0040.00417.43
8.1.70.0000.00817.47
8.1.60.0060.00317.51
8.1.50.0060.00317.45
8.1.40.0030.00617.48
8.1.30.0080.00017.54
8.1.20.0000.00717.64
8.1.10.0040.00417.49
8.1.00.0080.00017.58
8.0.300.0040.00420.04
8.0.290.0070.00016.75
8.0.280.0030.00318.49
8.0.270.0000.00817.26
8.0.260.0070.00017.13
8.0.250.0000.01016.95
8.0.240.0040.00416.88
8.0.230.0070.00016.85
8.0.220.0000.00716.88
8.0.210.0070.00016.75
8.0.200.0000.00616.81
8.0.190.0050.00216.94
8.0.180.0040.00416.93
8.0.170.0040.00416.87
8.0.160.0080.00016.88
8.0.150.0040.00416.66
8.0.140.0030.00616.86
8.0.130.0000.00613.27
8.0.120.0000.00716.82
8.0.110.0000.00816.86
8.0.100.0050.00316.88
8.0.90.0030.00316.78
8.0.80.0080.00816.86
8.0.70.0050.00216.91
8.0.60.0070.00016.70
8.0.50.0030.00616.89
8.0.30.0110.00717.07
8.0.20.0100.00817.40
8.0.10.0040.00416.98
8.0.00.0230.01516.90
7.4.330.0050.00015.55
7.4.320.0000.00616.45
7.4.300.0030.00316.59
7.4.290.0000.00616.50
7.4.280.0040.00416.49
7.4.270.0000.01016.48
7.4.260.0040.00416.50
7.4.250.0030.00316.48
7.4.240.0080.00016.58
7.4.230.0030.00316.65
7.4.220.0050.00316.39
7.4.210.0100.00816.59
7.4.200.0030.00316.34
7.4.160.0060.01016.47
7.4.140.0100.00717.86
7.4.130.0130.00316.52
7.4.120.0090.01016.51
7.4.110.0180.00316.54
7.4.100.0100.00716.49
7.4.90.0120.01216.51
7.4.80.0140.00919.39
7.4.70.0070.01116.48
7.4.60.0090.00616.71
7.4.50.0040.01116.33
7.4.40.0180.00016.43
7.4.00.0090.00615.04
7.3.330.0020.00213.18
7.3.320.0030.00313.41
7.3.310.0050.00216.24
7.3.300.0000.00716.24
7.3.290.0070.00016.35
7.3.280.0090.00916.39
7.3.260.0090.00816.50
7.3.240.0090.00816.43
7.3.230.0150.00316.42
7.3.210.0130.00316.52
7.3.200.0050.01116.55
7.3.190.0030.01316.49
7.3.180.0060.01016.45
7.3.170.0070.01116.62
7.3.160.0130.00316.31
7.2.330.0090.00916.66
7.2.320.0000.01716.88
7.2.310.0090.01116.40
7.2.300.0100.00716.87
7.2.290.0060.01416.68
7.2.60.0150.00814.89
7.2.50.0530.00315.22
7.2.40.0190.00515.10
7.2.30.0180.00515.12
7.2.20.0140.01115.11
7.2.10.0180.00615.03
7.2.00.0160.00915.09
7.1.200.0090.00615.45
7.1.170.0150.00713.89
7.1.160.0170.00513.79
7.1.150.0160.00614.08
7.1.140.0150.00813.86
7.1.130.0150.00714.00
7.1.120.0170.00713.83
7.1.110.0170.00813.92
7.1.100.0190.00713.87
7.1.90.0170.00814.06
7.1.80.0210.00813.89
7.1.70.0170.00713.92
7.1.60.0360.01031.95
7.1.50.0350.01031.92
7.1.40.0320.01231.82
7.1.30.0380.01231.88
7.1.20.0330.01331.91
7.1.10.0190.00513.79
7.1.00.0160.00813.96

preferences:
84.99 ms | 404 KiB | 6 Q