3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ 'ApplicantDetails_AdditionalApplicantDetails_OtherSurnames_OtherSurname' => [['name' => 'one'], ['name' => 'two']], 'ApplicantDetails_AdditionalApplicantDetails_OtherNames' => [['surname' => 'three', 'forename' => 'forename'],['surname' => 'four']], 'ApplicantDetails_AdditionalApplicantDetails_BirthSurname' => 'birthSurname', 'ApplicantDetails_PresentSurname' => 'presentSurname' ]; $surnameKeys = [ ['ApplicantDetails_AdditionalApplicantDetails_OtherSurnames_OtherSurname', 'name'], ['ApplicantDetails_AdditionalApplicantDetails_OtherNames', 'surname'], 'ApplicantDetails_AdditionalApplicantDetails_BirthSurname', 'ApplicantDetails_PresentSurname' ]; $something = []; array_walk($surnameKeys, function ($keys) { var_dump($keys); if (is_array($keys)) { if (isset($data[$keys[0]])) { echo 'here'; $something[] = array_column($data[$keys[0]], $keys[1]); } } }); // array_map(function ($keys) use ($data) { // if (is_array($keys)) { // if (isset($data[$keys[0]])) { // $something[] = array_column($data[$keys[0]], $keys[1]); // continue; // } // } // if (isset($data[$keys])) { // $something[] = $data[$keys]; // } // }, $surnameKeys); var_dump($something); // $uniq = array_unique($something); // var_dump($uniq);

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.0120.00616.38
8.3.50.0150.00016.10
8.3.40.0030.01018.71
8.3.30.0150.00018.33
8.3.20.0040.00420.34
8.3.10.0060.00321.95
8.3.00.0030.00619.16
8.2.180.0140.00018.41
8.2.170.0140.00022.96
8.2.160.0100.00320.52
8.2.150.0050.00324.18
8.2.140.0070.00024.66
8.2.130.0000.00821.18
8.2.120.0000.00726.35
8.2.110.0060.00620.99
8.2.100.0080.00418.34
8.2.90.0050.00319.23
8.2.80.0030.00517.97
8.2.70.0100.00017.63
8.2.60.0080.00017.80
8.2.50.0030.00518.10
8.2.40.0000.00820.54
8.2.30.0020.00521.02
8.2.20.0040.00418.02
8.2.10.0040.00418.16
8.2.00.0040.00418.16
8.1.280.0120.00325.92
8.1.270.0000.00821.95
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0100.01023.92
8.1.230.0100.00019.16
8.1.220.0000.00817.91
8.1.210.0040.00418.77
8.1.200.0070.00317.47
8.1.190.0000.00917.23
8.1.180.0040.00818.10
8.1.170.0000.00818.59
8.1.160.0000.00719.00
8.1.150.0000.00820.68
8.1.140.0000.00819.48
8.1.130.0030.00318.87
8.1.120.0040.00417.48
8.1.110.0080.00017.46
8.1.100.0040.00417.52
8.1.90.0050.00517.55
8.1.80.0080.00017.51
8.1.70.0000.00717.44
8.1.60.0040.00417.57
8.1.50.0000.00717.43
8.1.40.0040.00417.58
8.1.30.0050.00317.50
8.1.20.0080.00017.66
8.1.10.0000.00717.50
8.1.00.0060.00317.48
8.0.300.0060.00318.77
8.0.290.0080.00016.58
8.0.280.0000.00818.35
8.0.270.0000.00717.20
8.0.260.0070.00016.70
8.0.250.0040.00416.77
8.0.240.0000.00716.89
8.0.230.0070.00016.91
8.0.220.0030.00316.73
8.0.210.0070.00016.78
8.0.200.0040.00416.95
8.0.190.0070.00316.89
8.0.180.0040.00416.94
8.0.170.0070.00016.84
8.0.160.0000.00816.94
8.0.150.0000.00816.85
8.0.140.0030.00616.95
8.0.130.0050.00013.29
8.0.120.0040.00416.93
8.0.110.0000.00716.93
8.0.100.0080.00016.77
8.0.90.0030.00316.75
8.0.80.0170.00016.89
8.0.70.0040.00416.84
8.0.60.0040.00417.03
8.0.50.0000.00816.78
8.0.30.0110.00916.99
8.0.20.0100.00917.40
8.0.10.0050.00316.82
8.0.00.0090.00916.87
7.4.330.0050.00015.55
7.4.320.0000.00716.67
7.4.300.0000.00616.51
7.4.290.0050.00516.66
7.4.280.0040.00416.45
7.4.270.0040.00416.62
7.4.260.0030.00313.27
7.4.250.0000.00716.59
7.4.240.0070.00016.45
7.4.230.0030.00316.64
7.4.220.0130.01016.68
7.4.210.0080.00716.59
7.4.200.0040.00416.51
7.4.160.0080.00816.46
7.4.150.0050.01317.40
7.4.140.0110.00817.86
7.4.130.0090.00916.41
7.4.120.0090.01116.48
7.4.110.0140.00416.45
7.4.100.0130.00816.46
7.4.90.0080.00816.59
7.4.80.0110.00719.39
7.4.70.0040.01216.51
7.4.60.0090.00616.74
7.4.50.0070.00716.41
7.4.40.0030.01316.64
7.4.30.0120.00616.42
7.4.00.0130.00314.96
7.3.330.0050.00013.39
7.3.320.0050.00013.20
7.3.310.0040.00416.48
7.3.300.0060.00016.34
7.3.290.0070.00016.19
7.3.280.0080.00916.27
7.3.270.0140.00317.40
7.3.260.0090.00916.63
7.3.250.0100.00816.37
7.3.240.0120.00916.46
7.3.230.0150.00616.33
7.3.210.0140.00716.39
7.3.200.0060.01016.22
7.3.190.0070.01016.33
7.3.180.0070.01016.20
7.3.170.0140.00416.29
7.3.160.0030.01316.51
7.3.00.0030.00916.57
7.2.330.0120.00916.52
7.2.320.0040.01216.68
7.2.310.0100.00716.43
7.2.300.0000.01716.63
7.2.290.0050.01216.77
7.2.130.0030.01016.54
7.2.120.0070.00316.66
7.2.110.0030.00617.05
7.2.100.0040.01216.94
7.2.90.0030.00917.01
7.2.80.0100.00316.73
7.2.70.0030.01217.03
7.2.60.0060.00816.93
7.2.50.0060.00816.86
7.2.40.0070.00717.14
7.2.30.0040.00817.02
7.2.20.0090.00617.04
7.2.10.0000.01216.84
7.2.00.0070.00618.05
7.1.250.0110.00415.88
7.1.240.0040.00815.79
7.1.230.0060.00615.86
7.1.220.0080.00015.73
7.1.210.0090.00315.77
7.1.200.0040.00715.80
7.1.190.0030.00715.72
7.1.180.0040.00715.77
7.1.170.0080.00015.90
7.1.160.0070.00715.82
7.1.150.0040.01115.46
7.1.140.0000.01415.69
7.1.130.0030.01015.93
7.1.120.0040.00715.69
7.1.110.0050.00515.83
7.1.100.0000.01016.99
7.1.90.0030.00715.81
7.1.80.0070.00715.96
7.1.70.0090.00316.40
7.1.60.0130.00525.43
7.1.50.0090.01125.37
7.1.40.0130.00825.16
7.1.30.0050.01324.89
7.1.20.0040.01325.05
7.1.10.0050.00816.18
7.1.00.0080.00616.13
7.0.330.0000.01015.46
7.0.320.0030.00915.40
7.0.310.0070.00315.35
7.0.300.0090.00315.35
7.0.290.0110.00015.36
7.0.280.0070.00715.34
7.0.270.0060.00615.44
7.0.260.0030.00615.58
7.0.250.0080.00315.37
7.0.240.0100.00715.37
7.0.230.0120.00015.37
7.0.220.0000.01215.02
7.0.210.0040.00715.45
7.0.200.0030.00816.08
7.0.190.0030.01015.88
7.0.180.0040.01015.83
7.0.170.0030.01015.84
7.0.160.0060.00615.81
7.0.150.0120.00515.74
7.0.140.0060.00915.83
7.0.130.0080.00615.99
7.0.120.0030.01316.03
7.0.110.0060.00815.63
7.0.100.0040.01215.74
7.0.90.0030.00815.86
7.0.80.0030.01016.00
7.0.70.0020.01215.88
7.0.60.0060.00715.60
7.0.50.0060.00615.88
7.0.40.0040.01014.90
7.0.30.0060.00914.94
7.0.20.0030.00814.87
7.0.10.0070.00715.01
7.0.00.0060.00514.94
5.6.380.0080.00414.30

preferences:
72.06 ms | 401 KiB | 5 Q