3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Solution { /** * @param Integer[] $nums * @param Integer $val * @return Integer */ function removeElement(&$nums, $val) { $k = 0; foreach ($nums as $i => $v) { if ($v !== $val) { $k++; } else { unset($nums[$i]); } } var_dump($k, $nums); } } (new Solution)->removeElement([3,2,2,3], 3);

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.5.00.0110.01022.78
8.4.150.0080.00616.95
8.4.140.0380.00617.31
8.4.130.0360.00817.72
8.4.120.0380.00817.83
8.4.110.0400.00717.90
8.4.100.0340.01317.98
8.4.90.0410.00818.18
8.4.80.0480.00917.70
8.4.70.0390.01317.39
8.4.60.0480.00717.82
8.4.50.0340.01417.80
8.4.40.0400.00917.82
8.4.30.0410.00817.56
8.4.20.0410.00917.89
8.4.10.0460.00817.46
8.3.280.0070.00416.31
8.3.270.0320.01516.72
8.3.260.0360.01016.46
8.3.250.0380.00716.37
8.3.240.0380.01016.57
8.3.230.0360.00916.40
8.3.220.0360.00816.38
8.3.210.0370.00816.55
8.3.200.0370.01116.30
8.3.190.0440.00916.46
8.3.180.0420.01116.72
8.3.170.0420.00816.40
8.3.160.0410.01016.68
8.3.150.0390.00916.54
8.3.140.0380.00916.60
8.3.130.0320.00916.42
8.3.120.0330.01116.47
8.3.110.0360.00816.39
8.3.100.0470.00916.65
8.3.90.0420.01016.39
8.3.80.0390.00916.29
8.3.70.0400.00816.22
8.3.60.0360.01116.39
8.3.50.0390.00816.53
8.3.40.0400.00717.82
8.3.30.0340.00917.27
8.3.20.0360.00717.52
8.3.10.0310.00817.48
8.3.00.0350.00717.53
8.2.290.0310.00916.40
8.2.280.0320.00816.58
8.2.270.0300.00916.64
8.2.260.0300.01016.63
8.2.250.0310.00916.89
8.2.240.0320.00816.39
8.2.230.0300.01016.27
8.2.220.0320.00716.68
8.2.210.0330.01116.20
8.2.200.0390.00416.19
8.2.190.0300.01016.46
8.2.180.0330.00616.45
8.2.170.0330.00917.87
8.2.160.0310.01017.79
8.2.150.0320.01117.43
8.2.140.0340.00917.51
8.2.130.0510.00717.34
8.2.120.0380.00817.50
8.2.110.0370.01017.76
8.2.100.0310.01217.51
8.2.90.0350.00617.79
8.2.80.0330.00717.65
8.2.70.0340.00717.49
8.2.60.0310.01117.54
8.2.50.0470.01217.22
8.2.40.0320.00717.21
8.2.30.0330.00717.51
8.2.20.0330.00617.38
8.2.10.0270.01117.52
8.2.00.0300.00817.46

preferences:
30.38 ms | 403 KiB | 5 Q