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; return array_merge($_init, $init); } else { $_init[$key] = $add; return [ $key => array_merge($_init[$key], $init[$key]) ]; } } $a = [ 'phone' => [ 'code' => '+38', ], ]; $b = [ 'prefix' => '095', 'number' => '7700418', ]; var_dump(append($a, $b, 'phone')); $a = [ 'code' => '+38', ]; $b = [ 'prefix' => '095', 'number' => '7700418', ]; var_dump(append($a, $b));

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.0110.00416.75
8.3.50.0100.01216.39
8.3.40.0150.00018.67
8.3.30.0000.01418.84
8.3.20.0060.00318.86
8.3.10.0060.00318.77
8.3.00.0030.00619.25
8.2.180.0130.00716.38
8.2.170.0130.00922.96
8.2.160.0040.01118.82
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00720.79
8.2.110.0060.00322.20
8.2.100.0100.00317.84
8.2.90.0050.00318.95
8.2.80.0000.00918.03
8.2.70.0030.00617.63
8.2.60.0000.00817.93
8.2.50.0080.00018.04
8.2.40.0040.00419.23
8.2.30.0000.00917.65
8.2.20.0030.00717.54
8.2.10.0050.00317.70
8.2.00.0070.00017.61
8.1.280.0110.00425.92
8.1.270.0040.00423.99
8.1.260.0090.00026.35
8.1.250.0050.00328.09
8.1.240.0040.00420.96
8.1.230.0080.00417.83
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0030.00617.22
8.1.190.0080.00017.35
8.1.180.0000.00818.10
8.1.170.0000.00817.62
8.1.160.0040.00418.94
8.1.150.0050.00218.63
8.1.140.0040.00417.30
8.1.130.0050.00317.40
8.1.120.0000.00717.41
8.1.110.0040.00417.39
8.1.100.0000.00817.39
8.1.90.0070.00017.43
8.1.80.0040.00417.35
8.1.70.0020.00517.42
8.1.60.0060.00317.48
8.1.50.0080.00017.37
8.1.40.0060.00317.46
8.1.30.0030.00617.60
8.1.20.0040.00417.71
8.1.10.0000.00817.50
8.1.00.0030.00517.44
8.0.300.0000.00718.77
8.0.290.0020.00516.63
8.0.280.0050.00318.52
8.0.270.0030.00317.17
8.0.260.0030.00316.77
8.0.250.0000.00716.84
8.0.240.0070.00016.89
8.0.230.0030.00316.94
8.0.220.0040.00416.85
8.0.210.0040.00416.86
8.0.200.0000.00716.79
8.0.190.0000.00716.79
8.0.180.0080.00416.73
8.0.170.0050.00316.74
8.0.160.0030.00316.73
8.0.150.0000.00716.75
8.0.140.0040.00416.75
8.0.130.0030.00313.15
8.0.120.0040.00416.75
8.0.110.0040.00416.80
8.0.100.0040.00416.69
8.0.90.0000.00816.69
8.0.80.0060.00916.87
8.0.70.0000.00716.64
8.0.60.0000.00816.77
8.0.50.0050.00516.85
8.0.30.0000.01617.13
8.0.20.0090.01117.14
8.0.10.0000.00816.91
8.0.00.0150.00316.68
7.4.330.0020.00212.95
7.4.320.0000.00616.45
7.4.300.0030.00316.61
7.4.290.0000.00716.66
7.4.280.0000.00716.64
7.4.270.0000.00716.52
7.4.260.0030.00313.35
7.4.250.0030.00616.57
7.4.240.0070.00016.64
7.4.230.0000.01216.50
7.4.220.0220.00316.49
7.4.210.0120.00816.38
7.4.200.0030.00516.40
7.4.190.0040.00416.62
7.4.160.0130.00416.49
7.4.150.0160.00316.62
7.4.140.0170.00016.25
7.4.130.0060.01116.57
7.4.120.0000.01816.28
7.4.110.0100.01316.64
7.4.100.0130.00316.43
7.4.90.0060.01216.48
7.4.80.0140.00719.39
7.4.70.0050.01116.31
7.4.60.0100.00716.30
7.4.50.0030.00316.55
7.4.40.0030.00816.39
7.4.30.0110.00716.36
7.4.00.0110.00414.96
7.3.330.0060.00013.39
7.3.320.0000.00513.20
7.3.310.0040.00416.40
7.3.300.0030.00316.41
7.3.290.0100.00716.38
7.3.280.0070.01116.33
7.3.270.0110.00716.36
7.3.260.0140.00416.59
7.3.250.0130.00516.44
7.3.240.0170.00016.29
7.3.230.0120.00616.38
7.3.210.0170.00016.49
7.3.200.0120.00616.58
7.3.190.0040.01316.66
7.3.180.0060.01016.29
7.3.170.0060.01216.21
7.3.160.0110.00716.68
7.3.120.0040.01114.75
7.2.330.0140.00716.30
7.2.320.0040.02116.71
7.2.310.0100.01416.76
7.2.300.0000.01616.44
7.2.290.0100.01016.68
7.2.110.0280.00516.36
7.2.100.0140.01016.70
7.2.90.0270.01216.67
7.2.80.0130.01316.68
7.2.70.0160.01216.91
7.2.60.0140.00816.96
7.2.50.0220.00816.84
7.2.40.0260.00517.02
7.2.30.0350.01016.76
7.2.20.0230.00816.52
7.2.10.0160.01317.02
7.2.00.0200.01218.17
7.1.230.0270.00515.57
7.1.220.0150.01215.85
7.1.210.0220.00415.67
7.1.200.0160.00915.77
7.1.190.0180.00515.69
7.1.180.0310.01015.83
7.1.170.0150.01315.80
7.1.160.0160.01015.79
7.1.150.0210.00315.76
7.1.140.0400.01215.75
7.1.130.0450.00615.69
7.1.120.0190.00515.72
7.1.110.0330.01315.90
7.1.100.0200.00316.84
7.1.90.0120.00615.75
7.1.80.0190.00415.86
7.1.70.0140.00316.56
7.1.60.0370.01117.55
7.1.50.0150.01116.57
7.1.40.0750.01615.81
7.1.30.0200.01315.70
7.1.20.0430.01315.84
7.1.10.0160.00815.86
7.1.00.0130.03219.16
7.0.310.0170.00615.06
7.0.300.0130.01015.17
7.0.290.0200.00315.35
7.0.280.0110.01115.45
7.0.270.0110.01115.46
7.0.260.0170.00715.42
7.0.250.0110.01115.24
7.0.240.0410.00415.52
7.0.230.0180.00515.23
7.0.220.0280.01015.16
7.0.210.0160.00515.21
7.0.200.0080.00715.97
7.0.190.0180.00915.55
7.0.180.0140.01015.35
7.0.170.0590.01315.59
7.0.160.0120.00915.59
7.0.150.0180.00515.53
7.0.140.0120.03818.77
7.0.130.0120.01215.25
7.0.120.0110.04118.86
7.0.110.0120.00815.52
7.0.100.0640.00315.31
7.0.90.0100.01415.41
7.0.80.0100.01015.30
7.0.70.0180.00615.38
7.0.60.0080.04917.68
7.0.50.0150.04216.74
7.0.40.0090.03016.76
7.0.30.0200.02716.75
7.0.20.0180.04516.85
7.0.10.0190.02416.90
7.0.00.0110.04216.69
5.6.380.0220.00414.48
5.6.370.0210.00414.32
5.6.360.0200.00014.58
5.6.350.0170.00914.05
5.6.340.0170.01013.84
5.6.330.0130.01314.52
5.6.320.0180.01114.17
5.6.310.0210.00414.35
5.6.300.0140.01014.26
5.6.290.0190.00414.50
5.6.280.0110.04017.84
5.6.270.0130.01313.93
5.6.260.0170.00414.24
5.6.250.0180.00914.19
5.6.240.0140.01014.27
5.6.230.0120.00914.66
5.6.220.0120.01214.05
5.6.210.0100.04617.51
5.6.200.0120.04816.36
5.6.190.0130.04517.54
5.6.180.0220.02517.35
5.6.170.0270.01917.39
5.6.160.0150.02717.29
5.6.150.0110.02416.34
5.6.140.0140.04116.27
5.6.130.0150.02316.32
5.6.120.0190.03217.58
5.6.110.0200.04517.63
5.6.100.0150.02417.74
5.6.90.0110.02817.70
5.6.80.0140.04317.33
5.6.70.2230.02317.25
5.6.60.0290.01114.15
5.6.50.0400.00414.20
5.6.40.0240.00614.36
5.6.30.0330.01014.16
5.6.20.0230.00714.28
5.6.10.0330.00514.50
5.6.00.0200.00714.27
5.5.380.0160.00011.21
5.5.370.0120.00611.24
5.5.360.0110.00711.18
5.5.350.0160.04315.90
5.5.340.0120.04214.51
5.5.330.0070.02815.88
5.5.320.0140.02315.68
5.5.310.0210.02515.79
5.5.300.0080.02614.59
5.5.290.0110.02214.71
5.5.280.0130.04215.90
5.5.270.0080.04816.11
5.5.260.0130.01815.92
5.5.250.0180.03715.89
5.5.240.0140.04015.76
5.5.230.0090.00911.24
5.5.220.0190.00411.07
5.5.210.0110.00611.18
5.5.200.0070.01011.25
5.5.190.0140.00310.86
5.5.180.0180.00410.89
5.5.170.0250.00614.25
5.5.160.0100.00511.19
5.5.150.0110.00411.25
5.5.140.0110.00411.09
5.5.130.0060.01110.76
5.5.120.0140.00411.08
5.5.110.0090.00611.30
5.5.100.0190.00311.10
5.5.90.0130.00410.95
5.5.80.0140.00311.00
5.5.70.0090.00610.95
5.5.60.0140.00710.95
5.5.50.0050.00911.21
5.5.40.0140.00211.17
5.5.30.0110.00010.92
5.5.20.0100.00510.63
5.5.10.0070.00710.96
5.5.00.0050.01011.29
5.4.450.1280.02515.36
5.4.440.1280.02515.21
5.4.430.1280.01915.15
5.4.420.1290.02215.02
5.4.410.1000.02315.30
5.4.400.1270.02415.26
5.4.390.1110.02314.94
5.4.380.1240.02614.82
5.4.370.1300.02115.14
5.4.360.1360.01815.13
5.4.350.1320.02215.03
5.4.340.1180.02314.96
5.4.330.0140.00511.32
5.4.320.1260.02314.92
5.4.310.1070.02714.98
5.4.300.1360.02014.98
5.4.290.1130.02214.97
5.4.280.1320.02415.12
5.4.270.1300.02214.95
5.4.260.1270.02315.10
5.4.250.1250.02514.88
5.4.240.1110.02215.05
5.4.230.1250.02114.93
5.4.220.1260.02215.18
5.4.210.1320.01815.07
5.4.200.1290.02014.99
5.4.190.1240.02515.15
5.4.180.1160.01814.91
5.4.170.1280.02714.94
5.4.160.1310.02215.01
5.4.150.1220.02115.03
5.4.140.1250.02013.63
5.4.130.1240.01713.60
5.4.120.1220.01813.75
5.4.110.1130.01813.57
5.4.100.1270.02413.69
5.4.90.1270.02313.47
5.4.80.1260.02113.73
5.4.70.1220.01713.73
5.4.60.1250.02513.71
5.4.50.1320.01813.63
5.4.40.1300.02313.83
5.4.30.1280.02513.64
5.4.20.1260.01613.78
5.4.10.1370.02513.79
5.4.00.1320.02813.47
5.3.290.1250.01812.60
5.3.280.1190.02312.47
5.3.270.1460.02012.53
5.3.260.1500.02212.47
5.3.250.1310.02012.52
5.3.240.1280.02012.45
5.3.230.1240.02312.45
5.3.220.1320.02212.44
5.3.210.1180.02312.46
5.3.200.1240.02612.43
5.3.190.1310.02212.48
5.3.180.1300.02112.45
5.3.170.1190.02312.44
5.3.160.1180.02212.43
5.3.150.1180.01912.44
5.3.140.1240.02112.50
5.3.130.1350.02412.53
5.3.120.1160.02412.45
5.3.110.1300.02012.50
5.3.100.1270.02712.16
5.3.90.1250.02312.17
5.3.80.1170.02012.21
5.3.70.1280.01812.17
5.3.60.1210.01812.20
5.3.50.1390.02112.13
5.3.40.1220.02512.12
5.3.30.1270.02312.16
5.3.20.1250.02311.99
5.3.10.1280.02111.98
5.3.00.1300.02112.12
5.2.170.1140.01810.84
5.2.160.1050.01810.72
5.2.150.1070.01810.73
5.2.140.1130.01710.80
5.2.130.1070.02010.70
5.2.120.1170.01910.70
5.2.110.1110.01810.74
5.2.100.1150.01710.82
5.2.90.1110.01810.78
5.2.80.0970.01910.77
5.2.70.1130.01710.76
5.2.60.0980.01810.68
5.2.50.1000.01910.65
5.2.40.0770.02210.64
5.2.30.0870.02110.68
5.2.20.0900.02110.66
5.2.10.0830.01310.59
5.2.00.0750.01910.55
5.1.60.0810.01310.16
5.1.50.0790.01310.15
5.1.40.0890.01210.13
5.1.30.0760.01710.35
5.1.20.0820.01210.32
5.1.10.0780.01710.21
5.1.00.0860.01810.21
5.0.50.0500.0159.42
5.0.40.0470.0059.43
5.0.30.0400.0179.25
5.0.20.0380.0119.35
5.0.10.0390.0109.39
5.0.00.0420.0209.30
4.4.90.0420.0119.03
4.4.80.0450.0099.03
4.4.70.0400.0109.03
4.4.60.0410.0089.03
4.4.50.0430.0139.03
4.4.40.0500.0199.03
4.4.30.0440.0099.03
4.4.20.0460.0089.03
4.4.10.0540.0109.03
4.4.00.0400.0159.03
4.3.110.0290.0109.03
4.3.100.0500.0139.03
4.3.90.0480.0139.03
4.3.80.0380.0139.03
4.3.70.0440.0089.03
4.3.60.0440.0099.03
4.3.50.0500.0129.04
4.3.40.0430.0139.04
4.3.30.0150.0199.05
4.3.20.0220.0089.05
4.3.10.0240.0129.05
4.3.00.0200.0109.05

preferences:
38.7 ms | 401 KiB | 5 Q