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_recursive($surnameKeys, function ($keys) { var_dump($keys); }); // 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/4b5Yf
function name:  (null)
number of ops:  9
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_recursive'
          4        SEND_REF                                                 !1
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F4b5Yf%3A19%240'
   21     6        SEND_VAL                                                 ~6
          7        DO_ICALL                                                 
   39     8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F4b5Yf%3A19%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4b5Yf
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $keys
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                                                 
   21     4      > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.18 ms | 1395 KiB | 17 Q