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);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hQf4T
function name:  (null)
number of ops:  12
compiled vars:  !0 = $data, !1 = $surnameKeys, !2 = $something
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   17     2        ASSIGN                                                   !2, <array>
   19     3        INIT_FCALL                                               'array_walk'
          4        SEND_REF                                                 !1
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FhQf4T%3A19%240'
   28     6        SEND_VAL                                                 ~6
          7        DO_ICALL                                                 
   43     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
   46    11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FhQf4T%3A19%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 19
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 19
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
Branch analysis from position: 19
filename:       /in/hQf4T
function name:  {closure}
number of ops:  20
compiled vars:  !0 = $keys, !1 = $data, !2 = $something
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   22     4        TYPE_CHECK                                  128          !0
          5      > JMPZ                                                     ~4, ->19
   23     6    >   FETCH_DIM_R                                      ~5      !0, 0
          7        ISSET_ISEMPTY_DIM_OBJ                         0          !1, ~5
          8      > JMPZ                                                     ~6, ->19
   24     9    >   ECHO                                                     'here'
   25    10        INIT_FCALL                                               'array_column'
         11        FETCH_DIM_R                                      ~8      !0, 0
         12        FETCH_DIM_R                                      ~9      !1, ~8
         13        SEND_VAL                                                 ~9
         14        FETCH_DIM_R                                      ~10     !0, 1
         15        SEND_VAL                                                 ~10
         16        DO_ICALL                                         $11     
         17        ASSIGN_DIM                                               !2
         18        OP_DATA                                                  $11
   28    19    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FhQf4T%3A19%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.07 ms | 1396 KiB | 19 Q