3v4l.org

run code in 300+ PHP versions simultaneously
<?php function append(array $init, array $add, $key = null) { $_init = $init; if (is_null($key)) $_init[] = $add; else $_init[$key] = $add; return $_init; } $a = [ 'phone' => [ 'code' => '+38', ], ]; $b = [ 'prefix' => '095', 'number' => '7700418', ]; var_dump(append($a, $b, 'phone'));

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.60.0130.00618.52
8.3.50.0110.00621.99
8.3.40.0180.00418.85
8.3.30.0030.01418.67
8.3.20.0050.00318.64
8.3.10.0050.00321.00
8.3.00.0040.00423.41
8.2.180.0100.00716.50
8.2.170.0090.00622.96
8.2.160.0200.00020.35
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00419.46
8.2.110.0030.00620.58
8.2.100.0040.00717.72
8.2.90.0030.00619.02
8.2.80.0080.00018.04
8.2.70.0100.00017.63
8.2.60.0060.00318.03
8.2.50.0080.00018.07
8.2.40.0070.00018.22
8.2.30.0000.00721.21
8.2.20.0060.00317.64
8.2.10.0000.00717.55
8.2.00.0110.00017.57
8.1.280.0140.00725.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0070.00324.01
8.1.230.0040.00820.95
8.1.220.0040.00418.77
8.1.210.0000.00818.93
8.1.200.0030.00617.13
8.1.190.0000.00817.40
8.1.180.0040.00418.10
8.1.170.0040.00418.59
8.1.160.0040.00418.82
8.1.150.0040.00418.57
8.1.140.0000.00817.34
8.1.130.0050.00317.86
8.1.120.0080.00317.29
8.1.110.0060.00317.34
8.1.100.0040.00417.38
8.1.90.0050.00217.41
8.1.80.0030.00617.41
8.1.70.0040.00417.26
8.1.60.0050.00317.50
8.1.50.0080.00017.43
8.1.40.0060.00317.44
8.1.30.0040.00417.52
8.1.20.0080.00017.61
8.1.10.0000.00717.44
8.1.00.0040.00417.46
8.0.300.0050.00519.85
8.0.290.0000.00717.05
8.0.280.0030.00318.38
8.0.270.0070.00017.18
8.0.260.0030.00316.68
8.0.250.0040.00416.91
8.0.240.0000.00816.89
8.0.230.0040.00416.82
8.0.220.0070.00016.74
8.0.210.0000.00716.80
8.0.200.0000.00716.88
8.0.190.0070.00016.88
8.0.180.0060.00316.74
8.0.170.0040.00416.74
8.0.160.0000.00716.79
8.0.150.0000.00716.86
8.0.140.0070.00016.77
8.0.130.0060.00013.25
8.0.120.0040.00416.68
8.0.110.0080.00016.65
8.0.100.0030.00516.68
8.0.90.0000.00716.89
8.0.80.0070.01016.80
8.0.70.0050.00316.81
8.0.60.0000.00816.63
8.0.50.0040.00416.66
8.0.30.0090.01317.25
8.0.20.0120.00917.40
8.0.10.0000.00716.93
8.0.00.0120.00516.54
7.4.330.0030.00314.60
7.4.320.0030.00316.55
7.4.300.0030.00316.54
7.4.290.0030.00316.60
7.4.280.0000.00716.48
7.4.270.0030.00316.58
7.4.260.0000.00613.26
7.4.250.0050.00216.57
7.4.240.0000.00716.47
7.4.230.0040.00416.71
7.4.220.0030.01616.46
7.4.210.0060.01016.56
7.4.200.0000.00716.62
7.4.190.0070.00016.38
7.4.160.0090.00616.42
7.4.150.0120.00617.40
7.4.140.0210.00217.86
7.4.130.0210.01716.43
7.4.120.0100.00716.41
7.4.110.0100.00716.34
7.4.100.0080.01116.50
7.4.90.0120.00616.54
7.4.80.0080.01219.37
7.4.70.0070.01016.59
7.4.60.0030.01316.37
7.4.50.0000.01016.53
7.4.40.0070.00722.52
7.4.30.0090.00916.33
7.4.00.0030.01015.18
7.3.330.0000.00513.34
7.3.320.0030.00313.18
7.3.310.0030.00316.36
7.3.300.0040.00416.37
7.3.290.0100.00916.33
7.3.280.0100.01016.32
7.3.270.0060.01217.40
7.3.260.0090.00918.24
7.3.250.0140.00716.33
7.3.240.0120.00916.67
7.3.230.0030.01316.39
7.3.210.0120.00616.45
7.3.200.0100.00719.39
7.3.190.0060.01216.62
7.3.180.0070.01016.64
7.3.170.0030.01616.49
7.3.160.0030.01216.42
7.3.120.0070.00714.98
7.2.330.0090.00916.66
7.2.320.0190.00316.61
7.2.310.0040.01616.80
7.2.300.0090.01216.71
7.2.290.0140.00316.28
7.1.100.0030.01018.25
7.1.70.0070.00017.29
7.1.60.0110.01419.40
7.1.50.0000.01417.00
7.1.00.0100.06722.48
7.0.200.0030.00716.75
7.0.140.0100.06721.98
7.0.70.0170.07321.83
7.0.60.0100.06321.66
7.0.50.0030.08022.01
7.0.40.0130.07720.11
7.0.30.0130.06720.05
7.0.20.0030.06020.15
7.0.10.0070.04319.99
7.0.00.0030.06320.04
5.6.280.0070.06720.86
5.6.220.0070.08720.73
5.6.210.0130.07720.67
5.6.200.0070.06020.96
5.6.190.0000.05321.04
5.6.180.0000.08321.11
5.6.170.0100.06321.14
5.6.160.0000.08721.02
5.6.150.0000.05020.94
5.6.140.0070.08021.08
5.6.130.0030.06721.06
5.6.120.0030.05721.02
5.6.110.0030.08021.04
5.6.100.0000.06721.02
5.6.90.0030.08720.93
5.6.80.0000.07720.52
5.6.70.0070.05320.51
5.6.60.0030.08020.34
5.6.50.0000.05020.47
5.6.40.0030.05320.44
5.6.30.0030.08020.44
5.6.20.0000.07720.49
5.6.10.0100.05320.37
5.6.00.0000.05320.42
5.5.360.0100.05320.36
5.5.350.0030.09020.43
5.5.340.0030.08720.88
5.5.330.0030.07720.84
5.5.320.0000.05020.73
5.5.310.0100.07320.73
5.5.300.0030.08320.88
5.5.290.0000.05320.80
5.5.280.0130.07320.93
5.5.270.0030.08720.86
5.5.260.0130.08020.91
5.5.250.0130.07320.73
5.5.240.0000.07320.27
5.5.230.0070.03720.25
5.5.220.0100.08020.20
5.5.210.0070.07720.20
5.5.200.0070.06020.13
5.5.190.0100.07319.99
5.5.180.0070.05720.16
5.5.160.0030.08019.99
5.5.150.0100.05320.21
5.5.140.0030.06320.21
5.5.130.0170.06020.28
5.5.120.0070.07020.13
5.5.110.0170.06320.07
5.5.100.0000.07720.07
5.5.90.0070.05020.17
5.5.80.0000.05720.06
5.5.70.0000.06320.06
5.5.60.0100.07320.15
5.5.50.0170.07320.15
5.5.40.0070.07019.94
5.5.30.0130.06019.96
5.5.20.0000.08320.05
5.5.10.0070.06020.11
5.5.00.0030.08020.10
5.4.450.0030.05019.37
5.4.440.0030.08019.35
5.4.430.0170.06719.35
5.4.420.0070.08019.35
5.4.410.0070.07719.29
5.4.400.0000.06019.25
5.4.390.0070.07319.12
5.4.380.0030.04719.16
5.4.370.0100.05019.05
5.4.360.0030.08018.90
5.4.350.0000.08019.03
5.4.340.0030.04019.04
5.4.320.0030.08319.18
5.4.310.0100.06719.13
5.4.300.0030.05719.02
5.4.290.0100.07319.04
5.4.280.0070.05319.18
5.4.270.0070.06719.03
5.4.260.0000.04319.16
5.4.250.0000.04318.90
5.4.240.0030.05719.17
5.4.230.0000.08019.12
5.4.220.0070.05019.08
5.4.210.0000.07019.08
5.4.200.0070.07718.89
5.4.190.0000.07319.22
5.4.180.0070.07718.99
5.4.170.0030.04018.89
5.4.160.0070.07718.93
5.4.150.0000.05318.88
5.4.140.0070.06316.34
5.4.130.0030.07716.42
5.4.120.0170.06716.44
5.4.110.0000.04016.44
5.4.100.0030.06716.39
5.4.90.0100.05016.51
5.4.80.0070.06316.33
5.4.70.0030.07716.25
5.4.60.0000.06716.45
5.4.50.0000.07316.56
5.4.40.0000.06716.46
5.4.30.0000.05316.36
5.4.20.0070.07316.42
5.4.10.0030.05716.37
5.4.00.0000.06715.90
5.3.290.0030.06714.70
5.3.280.0000.06714.66
5.3.270.0030.07714.66
5.3.260.0200.06014.59
5.3.250.0070.06714.62
5.3.240.0000.04314.54
5.3.230.0070.06714.60
5.3.220.0000.06314.63
5.3.210.0000.08014.53
5.3.200.0030.07014.63
5.3.190.0000.08314.57
5.3.180.0030.04314.48
5.3.170.0070.07714.55
5.3.160.0030.08014.58
5.3.150.0030.06714.54
5.3.140.0070.04314.68
5.3.130.0000.05014.51
5.3.120.0000.04014.50
5.3.110.0030.06314.47
5.3.100.0030.07714.06
5.3.90.0000.07714.13
5.3.80.0070.07014.00
5.3.70.0030.05313.95
5.3.60.0170.03714.14
5.3.50.0000.06313.98
5.3.40.0070.05713.95
5.3.30.0000.07713.91
5.3.20.0030.05013.75
5.3.10.0030.07313.66
5.3.00.0070.07313.66
5.2.170.0030.04312.33
5.2.160.0030.06312.33
5.2.150.0070.06312.33
5.2.140.0070.04712.33
5.2.130.0000.05712.33
5.2.120.0000.05012.33
5.2.110.0030.06012.33
5.2.100.0000.05312.33
5.2.90.0030.06012.33
5.2.80.0000.06312.33
5.2.70.0030.05312.33
5.2.60.0000.06712.33
5.2.50.0030.03712.33
5.2.40.0000.05312.33
5.2.30.0000.07012.33
5.2.20.0070.06012.33
5.2.10.0100.04012.33
5.2.00.0000.05312.33
5.1.60.0030.05012.33
5.1.50.0070.03012.33
5.1.40.0030.02312.33
5.1.30.0000.05312.33
5.1.20.0000.05712.33
5.1.10.0030.04012.33
5.1.00.0000.05712.33
5.0.50.0000.03712.33
5.0.40.0030.03712.33
5.0.30.0000.06312.33
5.0.20.0000.02712.33
5.0.10.0000.04312.33
5.0.00.0030.06312.33
4.4.90.0000.03712.33
4.4.80.0100.02312.33
4.4.70.0000.02712.33
4.4.60.0000.03312.33
4.4.50.0000.03012.33
4.4.40.0030.05012.33
4.4.30.0030.01712.33
4.4.20.0030.03712.33
4.4.10.0000.03312.33
4.4.00.0030.05312.33
4.3.110.0000.02312.33
4.3.100.0000.03712.33
4.3.90.0000.03312.33
4.3.80.0030.03712.33
4.3.70.0000.02312.33
4.3.60.0000.01712.33
4.3.50.0000.01712.33
4.3.40.0000.03312.33
4.3.30.0000.02012.33
4.3.20.0000.02012.33
4.3.10.0030.01312.33
4.3.00.0000.01312.33

preferences:
52.49 ms | 401 KiB | 5 Q