3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'floorplans_0_valid_for_export' => 0, 'floorplans_0_title' => 'title 1', 'floorplans_0_house_area' => '40m²', 'floorplans_0_bedrooms' => 1, 'floorplans_1_valid_for_export' => 1, 'floorplans_1_title' => 'title xx', 'floorplans_1_house_area' => '90m²', 'floorplans_1_bedrooms' => '2', 'floorplans_2_valid_for_export' => 1, 'floorplans_2_title' => 'title 2', 'floorplans_2_house_area' => '50m²', 'floorplans_2_bedrooms' => 1, 'floorplans' => 3 ]; $labels = ['valid_for_export', 'title', 'house_area', 'bedrooms']; $result = []; for ($i = 0; $i < $array['floorplans']; ++$i) { if (!empty($array['floorplans_' . $i . '_valid_for_export'])) { foreach ($labels as $label) { $key = sprintf('floorplans_%s_%s', $i, $label); $result[$key] = $array[$key]; } } } 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.0110.00716.72
8.5.00.0100.01220.08
8.4.160.0150.01023.78
8.4.150.0020.00114.05
8.4.140.0130.00717.94
8.4.130.0140.00617.45
8.4.120.0020.00720.63
8.4.110.0120.00818.89
8.4.100.0140.00717.54
8.4.90.0100.00818.76
8.4.80.0040.00517.81
8.4.70.0120.00817.91
8.4.60.0060.01218.79
8.4.50.0110.00917.62
8.4.40.0030.00617.63
8.4.30.0100.01018.73
8.4.20.0100.00017.70
8.4.10.0040.00419.52
8.3.280.0150.00420.12
8.3.270.0100.01016.73
8.3.260.0100.00916.54
8.3.250.0080.00818.68
8.3.240.0110.00816.67
8.3.230.0120.00716.54
8.3.220.0110.00617.30
8.3.210.0110.00716.87
8.3.200.0030.00516.56
8.3.190.0100.00816.66
8.3.180.0080.01116.66
8.3.170.0060.00316.47
8.3.160.0100.00716.95
8.3.150.0150.00017.21
8.3.140.0120.00320.60
8.3.130.0040.00416.47
8.3.120.0080.00018.82
8.3.110.0070.01020.94
8.3.100.0080.00024.06
8.3.90.0000.01026.77
8.3.80.0060.00316.75
8.3.70.0070.01416.63
8.3.60.0040.01118.43
8.3.50.0120.00923.59
8.3.40.0140.00021.90
8.3.30.0080.00818.69
8.3.20.0040.00424.18
8.3.10.0090.00024.66
8.3.00.0050.00326.16
8.2.290.0130.00620.77
8.2.280.0090.00218.46
8.2.270.0090.00916.88
8.2.260.0100.01016.78
8.2.250.0100.01018.47
8.2.240.0130.00318.96
8.2.230.0040.00722.58
8.2.220.0060.00937.54
8.2.210.0080.00026.77
8.2.200.0070.00716.63
8.2.190.0120.00316.63
8.2.180.0140.00325.92
8.2.170.0200.00018.91
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00426.35
8.2.110.0000.01019.27
8.2.100.0110.00017.91
8.2.90.0080.00018.21
8.2.80.0000.00819.89
8.2.70.0070.00319.35
8.2.60.0050.00317.50
8.2.50.0000.00817.63
8.2.40.0050.00320.07
8.2.30.0070.00018.04
8.2.20.0020.00518.12
8.2.10.0040.00419.22
8.2.00.0040.00419.21
8.1.330.0090.00821.97
8.1.320.0070.01318.06
8.1.310.0070.01116.90
8.1.300.0080.00018.21
8.1.290.0040.00430.84
8.1.280.0120.00925.92
8.1.270.0050.00223.99
8.1.260.0070.00028.09
8.1.250.0040.00428.09
8.1.240.0090.00019.33
8.1.230.0050.00520.91
8.1.220.0030.00517.77
8.1.210.0000.00818.77
8.1.200.0030.00617.36
8.1.190.0050.00317.23
8.1.180.0030.00518.10
8.1.170.0080.00018.54
8.1.160.0000.00818.89
8.1.150.0000.00818.89
8.1.140.0000.00718.89
8.1.130.0070.00020.15
8.1.120.0040.00417.52
8.1.110.0000.00817.43
8.1.100.0040.00417.38
8.1.90.0000.00717.46
8.1.80.0040.00417.46
8.1.70.0070.00317.38
8.1.60.0050.00317.56
8.1.50.0050.00217.44
8.1.40.0030.00517.40
8.1.30.0040.00417.61
8.1.20.0000.00817.49
8.1.10.0080.00417.48
8.1.00.0000.00717.48
8.0.300.0050.00219.93
8.0.290.0000.00716.63
8.0.280.0030.00318.46
8.0.270.0030.00318.02
8.0.260.0030.00318.48
8.0.250.0030.00316.91
8.0.240.0060.00016.96
8.0.230.0070.00016.91
8.0.220.0030.00316.79
8.0.210.0030.00316.91
8.0.200.0030.00316.84
8.0.190.0050.00217.00
8.0.180.0040.00416.95
8.0.170.0050.00316.96
8.0.160.0050.00316.77
8.0.150.0040.00416.73
8.0.140.0000.00716.77
8.0.130.0030.00313.29
8.0.120.0040.00416.85
8.0.110.0030.00316.75
8.0.100.0050.00316.79
8.0.90.0040.00416.74
8.0.80.0070.01216.85
8.0.70.0040.00417.00
8.0.60.0040.00416.85
8.0.50.0000.00716.78
8.0.30.0120.00617.28
8.0.20.0100.01017.04
8.0.10.0030.00516.96
8.0.00.0140.00716.79
7.4.330.0020.00215.55
7.4.320.0030.00316.53
7.4.300.0000.00716.41
7.4.290.0030.00316.53
7.4.280.0040.00416.41
7.4.270.0000.00716.50
7.4.260.0000.00613.24
7.4.250.0050.00316.45
7.4.240.0040.00416.59
7.4.230.0070.00016.67
7.4.220.0020.00516.35
7.4.210.0120.00516.53
7.4.200.0070.00016.60
7.4.130.0130.00416.64
7.4.120.0030.01316.48
7.4.110.0080.00816.53
7.4.100.0100.00616.51
7.4.90.0030.01516.51
7.4.80.0130.00416.39
7.4.70.0120.00916.58
7.4.60.0070.01116.34
7.4.50.0090.01516.55
7.4.40.0090.01216.49
7.4.30.0090.00916.69
7.4.20.0060.01416.46
7.4.10.0190.00316.56
7.4.00.0100.00716.46
7.3.330.0030.00516.22
7.3.320.0000.00613.31
7.3.310.0070.00016.26
7.3.300.0040.00416.32
7.3.290.0090.00816.33
7.3.260.0100.01016.37
7.3.240.0100.00716.34
7.3.230.0030.01216.43
7.3.220.0070.01016.26
7.3.210.0060.01116.50
7.3.200.0110.00716.45
7.3.190.0140.00316.33
7.3.180.0120.00916.55
7.3.170.0120.01216.51
7.3.160.0060.01016.46
7.3.150.0100.00716.72
7.3.140.0160.00616.34
7.3.130.0150.00416.38
7.3.120.0220.00316.52
7.3.110.0070.01016.48
7.3.100.0060.01616.25
7.3.90.0110.00616.23
7.3.80.0090.01216.33
7.3.70.0070.01116.34
7.3.60.0120.00616.37
7.3.50.0070.01016.54
7.3.40.0030.01416.17
7.3.30.0030.01416.35
7.3.20.0060.01216.44
7.3.10.0140.00316.39
7.3.00.0390.01316.43
7.2.340.0130.00316.72
7.2.330.0110.00616.56
7.2.320.0090.00916.56
7.2.310.0140.00316.52
7.2.300.0140.01016.39
7.2.290.0030.01516.58
7.2.280.0030.01616.75
7.2.270.0130.01016.56
7.2.260.0030.01516.74
7.2.250.0090.01316.85
7.2.240.0090.00916.77
7.2.230.0140.01016.83
7.2.220.0100.01016.54
7.2.210.0120.01216.70
7.2.200.0140.00316.53
7.2.190.0130.00616.62
7.2.180.0110.00716.57
7.2.170.0030.01616.60
7.2.160.0030.01316.57
7.2.150.0180.00416.75
7.2.140.0080.01116.66
7.2.130.0030.01516.61
7.2.120.0140.00916.72
7.2.110.0130.00616.68
7.2.100.0120.00916.63
7.2.90.0060.01216.72
7.2.80.0090.01516.66
7.2.70.0180.00616.68
7.2.60.0100.01616.65
7.2.50.0120.01216.63
7.2.40.0120.01316.70
7.2.30.0150.00416.65
7.2.20.0040.01416.84
7.2.10.0130.01016.65
7.2.00.0090.00916.70

preferences:
36.26 ms | 403 KiB | 5 Q