3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_push_cust(&$arr, ...$args) { foreach ($args as $k => $v) { if (is_int($k)) { $arr[] = $v; } else { $arr[$k] = $v; } } } $arr = [1, 'a' => 2]; $arr2 = [3, 'b' => 4]; $res = $arr; array_push_cust($res, ...$arr2); print_r($res); $res = $arr; array_push($res, ...$arr2); print_r($res);

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.4.120.0120.00622.44
8.4.110.0100.01022.27
8.4.100.0080.00917.91
8.4.90.0090.01020.46
8.4.80.0100.00918.77
8.4.70.0060.00920.66
8.4.60.0110.00820.60
8.4.50.0110.00720.69
8.4.40.0090.00019.52
8.4.30.0140.00718.72
8.4.20.0100.01018.10
8.4.10.0100.00723.86
8.3.250.0110.00718.78
8.3.240.0130.00616.98
8.3.230.0070.00216.77
8.3.220.0040.00418.97
8.3.210.0150.00716.80
8.3.200.0050.00516.98
8.3.190.0050.00419.23
8.3.180.0110.00819.04
8.3.170.0130.00617.28
8.3.160.0110.00716.64
8.3.150.0130.00618.72
8.3.140.0000.00816.79
8.3.130.0090.00018.53
8.3.120.0080.00020.63
8.3.110.0000.00920.94
8.3.100.0070.01324.06
8.3.90.0060.00326.77
8.3.80.0090.00318.56
8.3.70.0120.00616.62
8.3.60.0110.01116.88
8.3.50.0110.00718.45
8.3.40.0110.00421.80
8.3.30.0040.01118.67
8.3.20.0080.00024.18
8.3.10.0040.00424.66
8.3.00.0060.00326.16
8.2.290.0050.00516.51
8.2.280.0120.00718.44
8.2.270.0090.00918.58
8.2.260.0030.00617.14
8.2.250.0090.00918.50
8.2.240.0040.00417.32
8.2.230.0000.00822.58
8.2.220.0000.00837.54
8.2.210.0150.00426.77
8.2.200.0030.00616.50
8.2.190.0090.00916.58
8.2.180.0120.00916.63
8.2.170.0060.00918.93
8.2.160.0100.00322.96
8.2.150.0080.00025.66
8.2.140.0090.00024.66
8.2.130.0080.00026.16
8.2.120.0070.00026.16
8.2.110.0080.00020.36
8.2.100.0040.00818.03
8.2.90.0030.00617.97
8.2.80.0000.00818.22
8.2.70.0040.00417.75
8.2.60.0000.00817.75
8.2.50.0040.00417.63
8.2.40.0150.00317.72
8.2.30.0100.00717.72
8.2.20.0110.00717.72
8.2.10.0190.00017.72
8.2.00.0120.00617.72
8.1.330.0080.01116.36
8.1.320.0120.00817.74
8.1.310.0100.00716.90
8.1.300.0080.00016.16
8.1.290.0030.00730.84
8.1.280.0040.01125.92
8.1.270.0070.00024.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0120.00022.17
8.1.230.0060.00622.15
8.1.220.0080.00017.74
8.1.210.0040.00419.15
8.1.200.0080.00017.35
8.1.190.0050.00317.35
8.1.180.0050.00318.10
8.1.170.0000.01017.72
8.1.160.0150.00217.72
8.1.150.0140.00417.72
8.1.140.0150.00417.72
8.1.130.0110.00717.72
8.1.120.0180.00017.72
8.1.110.0160.00317.72
8.1.100.0130.00417.72
8.1.90.0170.00017.72
8.1.80.0130.00417.72
8.1.70.0120.00617.72
8.1.60.0170.00317.72
8.1.50.0090.00917.72
8.1.40.0200.00017.72
8.1.30.0090.00917.72
8.1.20.0150.00417.72
8.1.10.0130.00617.72
8.1.00.0120.00917.72
8.0.300.0000.00720.03
8.0.290.0040.00416.75
8.0.280.0180.00017.72
8.0.270.0070.01017.72
8.0.260.0060.01217.72
8.0.250.0100.00717.72
8.0.240.0120.00617.72
8.0.230.0130.00417.72
8.0.220.0100.00717.72
8.0.210.0170.00017.72
8.0.200.0140.00317.72
8.0.190.0120.00617.72
8.0.180.0170.00017.72
8.0.170.0100.00717.72
8.0.160.0170.00017.72
8.0.150.0160.00017.72
8.0.140.0040.01317.72
8.0.130.0060.01117.72
8.0.120.0070.00718.31
8.0.110.0080.00817.72
8.0.100.0160.00017.72
8.0.90.0170.00017.72
8.0.80.0140.00317.72
8.0.70.0140.00417.72
8.0.60.0100.00717.72
8.0.50.0170.00017.72
8.0.30.0130.00417.72
8.0.20.0100.00717.72
8.0.10.0110.00517.72
7.4.330.0080.00117.72

preferences:
27.92 ms | 403 KiB | 5 Q