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]])) { $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.0160.00616.38
8.3.50.0090.00616.36
8.3.40.0140.00718.38
8.3.30.0060.00918.45
8.3.20.0070.00020.21
8.3.10.0080.00021.91
8.3.00.0040.00419.13
8.2.180.0070.00718.41
8.2.170.0090.00922.96
8.2.160.0100.00320.28
8.2.150.0050.00324.18
8.2.140.0050.00224.66
8.2.130.0080.00021.13
8.2.120.0030.00526.35
8.2.110.0070.00321.04
8.2.100.0040.00818.16
8.2.90.0030.00619.27
8.2.80.0030.00618.03
8.2.70.0070.00317.50
8.2.60.0030.00618.05
8.2.50.0000.00818.10
8.2.40.0060.00320.59
8.2.30.0030.00521.09
8.2.20.0000.00818.20
8.2.10.0000.00718.02
8.2.00.0050.00318.25
8.1.280.0110.00425.92
8.1.270.0080.00022.19
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0140.00719.07
8.1.230.0070.00419.15
8.1.220.0050.00317.74
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0000.00917.35
8.1.180.0000.00818.10
8.1.170.0000.00918.59
8.1.160.0040.00419.10
8.1.150.0000.00820.59
8.1.140.0000.00817.40
8.1.130.0030.00318.83
8.1.120.0030.00417.46
8.1.110.0030.00517.49
8.1.100.0000.00817.46
8.1.90.0040.00417.37
8.1.80.0040.00417.43
8.1.70.0070.00017.46
8.1.60.0000.00817.61
8.1.50.0070.00017.57
8.1.40.0050.00217.54
8.1.30.0080.00017.63
8.1.20.0040.00417.53
8.1.10.0040.00417.59
8.1.00.0050.00317.61
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00718.43
8.0.270.0050.00217.17
8.0.260.0000.00616.79
8.0.250.0000.00816.81
8.0.240.0070.00016.82
8.0.230.0080.00016.97
8.0.220.0070.00016.71
8.0.210.0040.00416.75
8.0.200.0080.00016.86
8.0.190.0070.00316.91
8.0.180.0030.00417.02
8.0.170.0000.00716.93
8.0.160.0000.00717.01
8.0.150.0080.00016.77
8.0.140.0000.00916.87
8.0.130.0000.00513.30
8.0.120.0030.00316.89
8.0.110.0030.00316.97
8.0.100.0000.00716.73
8.0.90.0050.00316.90
8.0.80.0120.00916.95
8.0.70.0040.00416.95
8.0.60.0030.00616.73
8.0.50.0040.00416.79
8.0.30.0070.01316.94
8.0.20.0100.00917.40
8.0.10.0040.00417.09
8.0.00.0060.01217.00
7.4.330.0030.00315.55
7.4.320.0020.00516.61
7.4.300.0060.00016.50
7.4.290.0100.00316.64
7.4.280.0040.00416.47
7.4.270.0000.00816.63
7.4.260.0030.00313.22
7.4.250.0070.00016.56
7.4.240.0060.00316.52
7.4.230.0030.00316.53
7.4.220.0090.00616.50
7.4.210.0110.00416.57
7.4.200.0030.00316.50
7.4.160.0130.00616.40
7.4.150.0130.01317.40
7.4.140.0080.01017.86
7.4.130.0150.00316.50
7.4.120.0070.01516.56
7.4.110.0090.00916.55
7.4.100.0030.01416.51
7.4.90.0080.00816.42
7.4.80.0090.00919.39
7.4.70.0090.00616.46
7.4.60.0030.01216.53
7.4.50.0130.00016.41
7.4.40.0130.00316.42
7.4.30.0060.01916.61
7.4.00.0030.01214.58
7.3.330.0000.00513.45
7.3.320.0000.00513.35
7.3.310.0070.00016.25
7.3.300.0050.00216.39
7.3.290.0040.00416.18
7.3.280.0100.00716.31
7.3.270.0070.01017.40
7.3.260.0130.00416.43
7.3.250.0120.00616.44
7.3.240.0140.00316.38
7.3.230.0030.01516.36
7.3.210.0120.00616.24
7.3.200.0100.00716.50
7.3.190.0110.00516.36
7.3.180.0070.01016.42
7.3.170.0120.00616.30
7.3.160.0090.00716.39
7.2.330.0110.00616.60
7.2.320.0100.00616.74
7.2.310.0040.01316.56
7.2.300.0070.01016.42
7.2.290.0060.01016.55
7.2.60.0030.01417.00
7.2.00.0030.00719.29
7.1.200.0090.00615.57
7.1.100.0000.01018.18
7.1.70.0090.00317.09
7.1.60.0130.01335.08
7.1.50.0130.01334.82
7.1.40.0130.01334.36
7.1.30.0190.00634.61
7.1.20.0100.01734.53
7.1.10.0000.01216.58
7.1.00.0060.00616.84
7.0.200.0060.00616.87
7.0.190.0000.01116.41
7.0.180.0090.00316.01
7.0.170.0090.00316.08
7.0.160.0100.00316.34
7.0.150.0060.00616.23
7.0.140.0000.01216.15
7.0.130.0090.00316.50
7.0.120.0080.00416.46
7.0.110.0080.00416.50
7.0.100.0040.00816.38
7.0.90.0030.01016.16
7.0.80.0030.01316.38
7.0.70.0060.00616.34
7.0.60.0000.01216.01
7.0.50.0090.00316.26
7.0.40.0060.00616.39
7.0.30.0030.00916.56
7.0.20.0070.00516.27
7.0.10.0030.00916.46
7.0.00.0040.00816.63

preferences:
51.42 ms | 401 KiB | 5 Q