3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrays = [ ['car' => '3', 'bus' => '2'], ['dog' => '1', 'car' => '2', 'bird' => '9'], ]; $defaults = array_fill(0, count($arrays), null); $result = []; foreach ($arrays as $i => $array) { foreach ($array as $k => $v){ $result[$k] ??= $defaults; $result[$k][$i] = $v; } } var_export($result);

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.01020.06
8.4.150.0010.00114.05
8.4.140.0170.00417.51
8.4.130.0150.00417.78
8.4.120.0130.00823.90
8.4.110.0120.00820.73
8.4.100.0130.00717.85
8.4.90.0120.00920.53
8.4.80.0040.00420.30
8.4.70.0050.00718.77
8.4.60.0130.01020.52
8.4.50.0140.00618.72
8.4.40.0100.01017.56
8.4.30.0100.01020.65
8.4.20.0070.00321.20
8.4.10.0040.00419.34
8.3.280.0100.01118.32
8.3.270.0120.00716.77
8.3.260.0100.00816.60
8.3.250.0120.00718.94
8.3.240.0110.00817.14
8.3.230.0040.00416.77
8.3.220.0090.00918.87
8.3.210.0150.00416.66
8.3.200.0040.00416.57
8.3.190.0090.00817.18
8.3.180.0090.00918.83
8.3.170.0090.00617.07
8.3.160.0090.00920.93
8.3.150.0040.01517.34
8.3.140.0000.00716.80
8.3.130.0330.00816.48
8.3.120.0360.00416.41
8.3.110.0290.01116.25
8.3.100.0310.01416.46
8.3.90.0300.00716.33
8.3.80.0260.00616.37
8.3.70.0210.00816.44
8.3.60.0340.00616.71
8.3.50.0350.00616.18
8.3.40.0300.00817.54
8.3.30.0360.00417.03
8.3.20.0310.00317.44
8.3.10.0250.00417.57
8.3.00.0140.00617.32
8.2.290.0110.00820.60
8.2.280.0080.01018.60
8.2.270.0120.00616.71
8.2.260.0070.01116.80
8.2.250.0300.00416.38
8.2.240.0360.00416.21
8.2.230.0310.00716.18
8.2.220.0240.01016.38
8.2.210.0320.00316.36
8.2.200.0240.00816.45
8.2.190.0290.01116.49
8.2.180.0170.01716.54
8.2.170.0260.01317.58
8.2.160.0270.00617.72
8.2.150.0260.00617.53
8.2.140.0380.00317.36
8.2.130.0270.00617.47
8.2.120.0190.01017.43
8.2.110.0260.01417.65
8.2.100.0240.00917.34
8.2.90.0270.01217.63
8.2.80.0260.01317.39
8.2.70.0240.01217.43
8.2.60.0320.00817.50
8.2.50.0290.01617.42
8.2.40.0320.00417.56
8.2.30.0260.00317.54
8.2.20.0230.00817.49
8.2.10.0290.00717.46
8.2.00.0330.00417.60
8.1.330.0110.00922.15
8.1.320.0070.00718.18
8.1.310.0030.01216.52
8.1.300.0330.01016.18
8.1.290.0260.01216.18
8.1.280.0350.00416.18
8.1.270.0330.00917.15
8.1.260.0260.00917.69
8.1.250.0340.00417.27
8.1.240.0260.01317.15
8.1.230.0230.01017.38
8.1.220.0270.00317.29
8.1.210.0180.01417.18
8.1.200.0240.01417.01
8.1.190.0290.01017.21
8.1.180.0250.01417.29
8.1.170.0310.00717.24
8.1.160.0360.00016.95
8.1.150.0250.01017.01
8.1.140.0280.00716.96
8.1.130.0190.01617.15
8.1.120.0270.00817.42
8.1.110.0310.00317.32
8.1.100.0340.00317.38
8.1.90.0300.00617.13
8.1.80.0300.00717.16
8.1.70.0330.01017.01
8.1.60.0130.00717.29
8.1.50.0240.00317.11
8.1.40.0330.00717.26
8.1.30.0290.00617.21
8.1.20.0360.00417.34
8.1.10.0300.00917.33
8.1.00.0330.00417.20

preferences:
37.77 ms | 403 KiB | 5 Q