3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d = [ ['type' => 25500, 'month' => 'July'], ['type' => 5465, 'month' => 'January'], ['type' => 40000, 'month' => 'April'], ['type' => 35000, 'month' => 'June'], ['type' => 10000, 'month' => 'February'] ]; $allmonths = ['January', 'February', 'March', 'April', 'May','June','July','August', 'September','October','November','December']; $lookup = array_column($d, null, 'month'); // assign temporary keys for improved efficiency $result = []; foreach ($allmonths as $month) { $result[] = $lookup[$month] ?? ['type' => 0, 'month' => $month]; } 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.10.0080.01116.82
8.5.00.0130.01020.04
8.4.160.0140.00819.48
8.4.150.0030.00014.05
8.4.140.0120.01117.38
8.4.130.0110.01117.88
8.4.120.0150.00423.78
8.4.110.0040.00518.05
8.4.100.0110.01117.64
8.4.90.0080.00520.82
8.4.80.0040.00418.91
8.4.70.0050.00919.06
8.4.60.0150.00520.43
8.4.50.0100.01018.78
8.4.40.0130.00719.27
8.4.30.0130.00620.66
8.4.20.0100.01018.79
8.4.10.0060.00317.61
8.3.280.0120.00818.39
8.3.270.0120.00916.67
8.3.260.0080.00516.85
8.3.250.0100.00818.93
8.3.240.0120.00717.12
8.3.230.0100.01016.53
8.3.220.0100.00818.94
8.3.210.0090.01016.66
8.3.200.0050.00316.75
8.3.190.0110.00416.64
8.3.180.0140.00418.45
8.3.170.0060.01617.41
8.3.160.0150.00318.29
8.3.150.0070.00719.04
8.3.140.0080.00018.52
8.3.130.0050.00316.61
8.3.120.0040.00420.73
8.3.110.0000.00816.72
8.3.100.0030.00616.77
8.3.90.0040.00426.77
8.3.80.0040.00719.36
8.3.70.0180.00018.23
8.3.60.0070.00716.75
8.3.50.0110.00717.97
8.3.40.0120.00618.79
8.3.30.0110.00318.76
8.3.20.0030.00524.18
8.3.10.0080.00024.66
8.3.00.0000.00726.16
8.2.290.0110.00920.25
8.2.280.0050.00416.93
8.2.270.0110.00718.94
8.2.260.0080.00016.69
8.2.250.0080.00016.40
8.2.240.0030.00717.13
8.2.230.0040.01120.94
8.2.220.0120.00324.06
8.2.210.0080.00026.77
8.2.200.0060.00318.88
8.2.190.0000.01516.58
8.2.180.0110.01125.92
8.2.170.0040.01118.82
8.2.160.0070.00722.96
8.2.150.0070.00025.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00419.36
8.2.110.0030.00622.29
8.2.100.0090.00317.84
8.2.90.0000.00817.84
8.2.80.0030.00519.10
8.2.70.0060.00317.63
8.2.60.0000.00817.75
8.2.50.0040.00417.68
8.2.40.0080.00020.07
8.2.30.0000.00719.37
8.2.20.0030.00618.12
8.2.10.0000.00821.08
8.2.00.0040.00419.33
8.1.330.0130.00621.80
8.1.320.0090.01017.73
8.1.310.0150.00318.16
8.1.300.0120.00618.05
8.1.290.0100.00030.84
8.1.280.0150.00025.92
8.1.270.0050.00224.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00022.60
8.1.230.0090.00320.91
8.1.220.0080.00017.75
8.1.210.0000.00818.78
8.1.200.0030.00617.25
8.1.190.0000.00717.23
8.1.180.0080.00018.10
8.1.170.0060.00317.62
8.1.160.0080.00018.82
8.1.150.0060.00318.88
8.1.140.0000.00719.07
8.1.130.0000.00720.06
8.1.120.0080.00017.38
8.1.110.0040.00417.49
8.1.100.0080.00017.44
8.1.90.0000.00717.48
8.1.80.0000.01017.41
8.1.70.0040.00417.38
8.1.60.0040.00417.61
8.1.50.0040.00417.59
8.1.40.0000.00717.50
8.1.30.0060.00317.68
8.1.20.0040.00417.71
8.1.10.0050.00317.55
8.1.00.0000.00817.46
8.0.300.0000.00820.13
8.0.290.0060.00316.63
8.0.280.0040.00418.46
8.0.270.0030.00516.74
8.0.260.0070.00018.64
8.0.250.0000.00716.92
8.0.240.0040.00416.96
8.0.230.0070.00016.93
8.0.220.0000.00816.87
8.0.210.0030.00316.78
8.0.200.0000.00716.93
8.0.190.0040.00416.83
8.0.180.0040.00416.96
8.0.170.0070.00416.92
8.0.160.0030.00516.92
8.0.150.0080.00316.87
8.0.140.0000.00716.75
8.0.130.0050.00013.26
8.0.120.0040.00416.84
8.0.110.0080.00016.79
8.0.100.0000.00716.85
8.0.90.0050.00316.91
8.0.80.0000.01616.96
8.0.70.0200.01016.96
8.0.60.0150.01016.82
8.0.50.0180.00716.88
8.0.30.0140.01116.93
8.0.20.0220.00416.94
8.0.10.0190.01116.98
8.0.00.0170.00017.01
7.4.330.0000.00516.81
7.4.320.0000.00616.38
7.4.300.0030.00316.61
7.4.290.0030.00616.58
7.4.280.0000.00816.47
7.4.270.0000.00716.42
7.4.260.0040.00413.23
7.4.250.0070.00016.49
7.4.240.0000.00816.49
7.4.230.0000.00716.55
7.4.220.0030.00316.64
7.4.210.0090.00916.57
7.4.200.0210.00916.47
7.4.190.0240.00716.61
7.4.180.0230.00316.60
7.4.160.0130.01316.63
7.4.150.0170.00716.57
7.4.140.0300.00616.43
7.4.130.0240.01016.59
7.4.120.0150.01116.51
7.4.110.0150.01116.50
7.4.100.0170.00716.48
7.4.90.0110.01516.56
7.4.80.0250.00316.59
7.4.70.0160.00816.45
7.4.60.0170.00716.57
7.4.50.0180.00716.44
7.4.40.0210.00416.41
7.4.30.0180.00516.54
7.4.20.0060.01716.34
7.4.10.0180.00516.56
7.4.00.0190.00516.63
7.3.330.0040.00416.24
7.3.320.0040.00413.17
7.3.310.0070.00016.27
7.3.300.0000.00616.33
7.3.290.0110.00516.34
7.3.280.0220.00716.29
7.3.270.0290.00516.36
7.3.260.0290.00216.36
7.3.250.0150.01516.31
7.3.240.0200.00916.36
7.3.230.0230.01316.36
7.3.220.0250.00616.21
7.3.210.0080.01616.26
7.3.200.0180.01416.18
7.3.190.0210.00516.26
7.3.180.0150.01316.29
7.3.170.0200.00516.21
7.3.160.0280.00416.25
7.3.150.0210.00516.21
7.3.140.0150.00916.29
7.3.130.0230.00416.38
7.3.120.0180.00716.30
7.3.110.0260.00016.31
7.3.100.0200.01016.20
7.3.90.0170.00916.52
7.3.80.0170.00916.30
7.3.70.0140.00316.40
7.3.60.0060.00916.46
7.3.50.0000.01516.43
7.3.40.0090.01216.47
7.3.30.0130.00516.54
7.3.20.0060.01216.40
7.3.10.0120.00316.47
7.3.00.0130.00416.38

preferences:
180.44 ms | 403 KiB | 5 Q