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) use ($data) { var_dump($keys); if (is_array($keys)) { if (isset($data[$keys[0]])) { var_dump($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.40.0070.00718.97
8.3.30.0090.00618.84
8.3.20.0040.00420.12
8.3.10.0050.00321.73
8.3.00.0080.00019.14
8.2.170.0180.00022.96
8.2.160.0130.00720.16
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00421.13
8.2.120.0070.00026.35
8.2.110.0050.00520.97
8.2.100.0080.00418.09
8.2.90.0080.00019.26
8.2.80.0040.00418.16
8.2.70.0050.00517.63
8.2.60.0030.00617.93
8.2.50.0030.00618.10
8.2.40.0000.00720.60
8.2.30.0080.00020.97
8.2.20.0040.00418.07
8.2.10.0020.00518.15
8.2.00.0000.00718.16
8.1.270.0030.00622.14
8.1.260.0080.00026.35
8.1.250.0030.00528.09
8.1.240.0030.00623.98
8.1.230.0080.00419.15
8.1.220.0050.00317.79
8.1.210.0040.00418.77
8.1.200.0040.00417.25
8.1.190.0040.00417.35
8.1.180.0030.00518.10
8.1.170.0050.00318.50
8.1.160.0000.00819.03
8.1.150.0030.00620.67
8.1.140.0000.00819.60
8.1.130.0070.00018.83
8.1.120.0030.00517.50
8.1.110.0050.00317.47
8.1.100.0050.00317.53
8.1.90.0050.00517.54
8.1.80.0030.00317.41
8.1.70.0060.00317.48
8.1.60.0060.00317.61
8.1.50.0030.00617.57
8.1.40.0040.00417.52
8.1.30.0050.00317.56
8.1.20.0040.00417.68
8.1.10.0000.00717.53
8.1.00.0030.00617.52
8.0.300.0040.00418.77
8.0.290.0080.00016.75
8.0.280.0030.00318.50
8.0.270.0030.00317.19
8.0.260.0030.00316.71
8.0.250.0030.00316.99
8.0.240.0000.00716.87
8.0.230.0050.00316.86
8.0.220.0040.00416.80
8.0.210.0040.00416.79
8.0.200.0060.00016.84
8.0.190.0070.00316.95
8.0.180.0040.00416.88
8.0.170.0070.00016.96
8.0.160.0040.00416.87
8.0.150.0000.00716.85
8.0.140.0000.00916.80
8.0.130.0030.00313.30
8.0.120.0030.00616.86
8.0.110.0000.00716.87
8.0.100.0000.00716.94
8.0.90.0040.00416.95
8.0.80.0080.00916.84
8.0.70.0030.00516.88
8.0.60.0050.00216.95
8.0.50.0000.00716.84
8.0.30.0060.01217.31
8.0.20.0110.00817.40
8.0.10.0000.00716.92
8.0.00.0180.00017.10
7.4.330.0000.00515.55
7.4.320.0030.00316.66
7.4.300.0070.00016.62
7.4.290.0070.00316.51
7.4.280.0040.00416.53
7.4.270.0030.00316.58
7.4.260.0000.00513.31
7.4.250.0040.00416.56
7.4.240.0040.00416.53
7.4.230.0000.00716.69
7.4.220.0130.01016.69
7.4.210.0080.00916.55
7.4.200.0050.00316.60
7.4.160.0090.00916.56
7.4.150.0120.00617.40
7.4.140.0120.00617.86
7.4.130.0130.00516.41
7.4.120.0090.01216.52
7.4.110.0090.01516.29
7.4.100.0110.00616.42
7.4.90.0140.00316.54
7.4.80.0140.00519.39
7.4.70.0170.00016.34
7.4.60.0060.00916.48
7.4.50.0120.00316.62
7.4.40.0070.01016.34
7.4.30.0080.00816.60
7.4.00.0140.00014.76
7.3.330.0060.00013.40
7.3.320.0060.00013.36
7.3.310.0060.00016.24
7.3.300.0030.00316.25
7.3.290.0000.00716.32
7.3.280.0070.01016.30
7.3.270.0030.01317.40
7.3.260.0120.00916.38
7.3.250.0140.00516.31
7.3.240.0130.00616.50
7.3.230.0040.01316.29
7.3.210.0090.00916.36
7.3.200.0090.01216.43
7.3.190.0090.00616.59
7.3.180.0030.01416.33
7.3.170.0130.00616.35
7.3.160.0100.01016.35
7.3.120.0080.00814.71
7.3.110.0040.01414.60
7.3.100.0040.01114.78
7.3.90.0140.00014.64
7.3.80.0070.01014.96
7.3.70.0060.00614.50
7.3.60.0110.00314.78
7.3.50.0110.00314.71
7.3.40.0070.00714.59
7.3.30.0070.01014.53
7.3.20.0140.00316.59
7.3.10.0070.00716.72
7.3.00.0070.01016.61
7.2.330.0140.00516.45
7.2.320.0120.00916.82
7.2.310.0090.00916.80
7.2.300.0150.00316.77
7.2.290.0100.00716.85
7.2.240.0040.01214.80
7.2.230.0000.01415.21
7.2.220.0030.00914.97
7.2.210.0040.00714.83
7.2.200.0070.01015.21
7.2.190.0090.00615.16
7.2.180.0060.00915.32
7.2.170.0030.01015.13
7.2.160.0000.01415.05
7.2.150.0000.01216.78
7.2.140.0090.00917.04
7.2.130.0090.00617.00
7.2.120.0060.01016.75
7.2.110.0070.01017.07
7.2.100.0100.00717.01
7.2.90.0120.00016.65
7.2.80.0030.01316.84
7.2.70.0090.00616.62
7.2.60.0070.00616.68
7.2.50.0090.00916.83
7.2.40.0000.01816.86
7.2.30.0030.01316.88
7.2.20.0060.01016.67
7.2.10.0000.01117.01
7.2.00.0060.01117.96
7.1.330.0030.01415.75
7.1.320.0060.00915.78
7.1.310.0030.01315.67
7.1.300.0080.00315.82
7.1.290.0050.00315.56
7.1.280.0090.00315.91
7.1.270.0130.00315.84
7.1.260.0040.00816.00
7.1.250.0110.00015.84
7.1.200.0040.01215.59
7.1.100.0030.01017.95
7.1.70.0030.00916.87
7.1.60.0130.01334.95
7.1.50.0150.01134.58
7.1.40.0220.00334.15
7.1.30.0180.01834.66
7.1.20.0200.00634.55
7.1.10.0030.01016.44
7.1.00.0080.00516.54
7.0.200.0030.00916.88
7.0.190.0030.00916.75
7.0.180.0030.00916.37
7.0.170.0070.01016.16
7.0.160.0060.00616.45
7.0.150.0060.00616.29
7.0.140.0090.00316.37
7.0.130.0000.01216.60
7.0.120.0040.00816.75
7.0.110.0030.00916.33
7.0.100.0000.01216.25
7.0.90.0090.00316.21
7.0.80.0040.00816.40
7.0.70.0060.00916.43
7.0.60.0100.00616.01
7.0.50.0000.01116.26
7.0.40.0030.00916.50
7.0.30.0000.01216.43
7.0.20.0030.01016.18
7.0.10.0080.00416.46
7.0.00.0030.00916.30

preferences:
56.08 ms | 400 KiB | 5 Q