3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = []; // Create empty array var_dump($array); echo "-----\n"; $array = ['abc']; // Assign the value ['abc'] (array with one element 0 => 'abc' to $array) var_dump($array); echo "-----\n"; $array[] = 'abc'; // Add a new element to the array 'abc' var_dump($array); echo "-----\n"; $array += [0 => 'NEWabc', 4 => 'anotherABC']; // Concats two arrays, but the key [0] is already existing in the left-handside array so it ignores the first value from the right hand side array and only adds the second element (key 4 is not existing) var_dump($array);

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.0090.00918.56
8.3.50.0150.00018.20
8.3.40.0070.00718.68
8.3.30.0060.00818.75
8.3.20.0080.00021.91
8.3.10.0040.00423.52
8.3.00.0040.00420.94
8.2.180.0100.00716.63
8.2.170.0080.00622.96
8.2.160.0070.01020.14
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00719.32
8.2.120.0040.00426.35
8.2.110.0080.01220.97
8.2.100.0070.00417.91
8.2.90.0050.00517.88
8.2.80.0030.00517.97
8.2.70.0040.00417.89
8.2.60.0040.00418.16
8.2.50.0000.00818.10
8.2.40.0060.00319.40
8.2.30.0020.00519.24
8.2.20.0040.00418.05
8.2.10.0040.00419.21
8.2.00.0070.00019.11
8.1.280.0070.00725.92
8.1.270.0030.00622.14
8.1.260.0080.00026.35
8.1.250.0070.00728.09
8.1.240.0040.00421.42
8.1.230.0080.00417.46
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0030.00717.23
8.1.190.0030.00617.00
8.1.180.0000.00918.10
8.1.170.0000.00818.49
8.1.160.0040.00418.86
8.1.150.0000.00818.83
8.1.140.0000.00722.04
8.1.130.0000.00817.35
8.1.120.0000.00817.29
8.1.110.0000.00817.29
8.1.100.0070.00417.39
8.1.90.0040.00417.39
8.1.80.0080.00017.39
8.1.70.0030.00317.29
8.1.60.0000.00817.54
8.1.50.0060.00317.34
8.1.40.0000.00817.41
8.1.30.0060.00317.55
8.1.20.0030.00517.41
8.1.10.0000.00817.41
8.1.00.0040.00417.30
8.0.300.0050.00318.77
8.0.290.0050.00716.58
8.0.280.0040.00418.35
8.0.270.0070.00016.84
8.0.260.0060.00316.79
8.0.250.0030.00316.98
8.0.240.0040.00416.91
8.0.230.0070.00016.98
8.0.220.0000.00816.82
8.0.210.0000.00716.84
8.0.200.0060.00016.89
8.0.190.0030.00616.88
8.0.180.0000.00916.91
8.0.170.0060.00616.82
8.0.160.0000.00716.89
8.0.150.0000.00816.86
8.0.140.0040.00316.82
8.0.130.0000.00713.38
8.0.120.0020.00516.87
8.0.110.0040.00416.68
8.0.100.0070.00016.88
8.0.90.0070.00016.83
8.0.80.0000.01416.80
8.0.70.0040.00416.76
8.0.60.0000.00716.71
8.0.50.0040.00416.89
8.0.30.0090.00917.02
8.0.20.0090.00917.40
8.0.10.0040.00417.02
8.0.00.0120.01116.58
7.4.330.0050.00015.55
7.4.320.0000.00716.52
7.4.300.0030.00316.43
7.4.290.0030.00316.54
7.4.280.0030.00516.53
7.4.270.0040.00416.52
7.4.260.0030.00316.34
7.4.250.0040.00416.42
7.4.240.0040.00416.34
7.4.230.0000.00716.63
7.4.220.0040.00416.39
7.4.210.0080.00716.51
7.4.200.0000.00716.27
7.4.160.0070.01116.42
7.4.140.0120.00817.86
7.4.130.0060.01116.48
7.4.120.0200.00016.47
7.4.110.0160.00916.32
7.4.100.0130.00416.44
7.4.90.0190.00316.57
7.4.80.0130.00619.39
7.4.70.0060.01116.34
7.4.60.0090.00916.42
7.4.50.0090.00616.13
7.4.40.0140.00416.47
7.4.00.0130.00314.95
7.3.330.0020.00213.13
7.3.320.0030.00313.07
7.3.310.0030.00316.25
7.3.300.0000.00616.24
7.3.290.0000.00716.24
7.3.280.0100.00716.21
7.3.260.0120.00716.38
7.3.240.0090.00916.42
7.3.230.0110.00716.15
7.3.210.0120.00916.19
7.3.200.0100.00616.31
7.3.190.0090.00916.29
7.3.180.0070.01316.24
7.3.170.0060.01616.16
7.3.160.0080.00816.25
7.3.00.0740.00314.70
7.2.330.0170.00016.56
7.2.320.0120.00616.41
7.2.310.0030.01216.63
7.2.300.0030.01316.57
7.2.290.0050.01216.26
7.2.130.0530.01014.99
7.2.120.0550.00014.84
7.2.110.0830.01014.77
7.2.100.0560.00714.65
7.2.90.0580.01314.77
7.2.80.0660.00314.75
7.2.70.0470.00614.82
7.2.60.0470.00314.84
7.2.50.0670.00714.61
7.2.40.0480.00714.97
7.2.30.0510.01114.96
7.2.20.0510.01014.94
7.2.10.0490.00714.86
7.2.00.0570.00415.08
7.1.250.0440.01113.69

preferences:
61.83 ms | 400 KiB | 5 Q