3v4l.org

run code in 500+ PHP versions simultaneously
<?php $testArray = array ( 'BrowseNodeId' => 343505011, 'Name' => 'Kinderzimmer', 'Ancestors' => array ( 'BrowseNode' => array ( 'BrowseNodeId' => 3517801, 'Name' => 'Mbel', 'Ancestors' => array ( 'BrowseNode' => array ( 'BrowseNodeId' => 3312261, 'Name' => 'Mbel & Wohnaccessoires', 'Ancestors' => array ( 'BrowseNode' => array ( 'BrowseNodeId' => 3169011, 'Name' => 'Kategorien', 'IsCategoryRoot' => 1, 'Ancestors' => array ( 'BrowseNode' => array ( 'BrowseNodeId' => 3167641, 'Name' => 'Kche & Haushalt', ) ) ) ) ) ) ) ) ) ; function getAllInfo($inputArray, $outputArray = array()) { $outputArray[] = array( 'BrowseNodeId' => $inputArray['BrowseNodeId'], 'Name' => $inputArray['Name'] ); if(isset($inputArray['Ancestors']['BrowseNode'])) { return getAllInfo($inputArray['Ancestors']['BrowseNode'], $outputArray); } return $outputArray; } var_dump(getAllInfo($testArray));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jd7hY
function name:  (null)
number of ops:  8
compiled vars:  !0 = $testArray
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   45     1        INIT_FCALL                                                   'var_dump'
          2        INIT_FCALL                                                   'getallinfo'
          3        SEND_VAR                                                     !0
          4        DO_FCALL                                          0  $2      
          5        SEND_VAR                                                     $2
          6        DO_ICALL                                                     
          7      > RETURN                                                       1

Function getallinfo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jd7hY
function name:  getAllInfo
number of ops:  21
compiled vars:  !0 = $inputArray, !1 = $outputArray
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   33     0  E >   RECV                                                 !0      
          1        RECV_INIT                                            !1      <array>
   35     2        FETCH_DIM_R                                          ~3      !0, 'BrowseNodeId'
          3        INIT_ARRAY                                           ~4      ~3, 'BrowseNodeId'
   36     4        FETCH_DIM_R                                          ~5      !0, 'Name'
          5        ADD_ARRAY_ELEMENT                                    ~4      ~5, 'Name'
   34     6        ASSIGN_DIM                                                   !1
   36     7        OP_DATA                                                      ~4
   38     8        FETCH_DIM_IS                                         ~6      !0, 'Ancestors'
          9        ISSET_ISEMPTY_DIM_OBJ                             0          ~6, 'BrowseNode'
         10      > JMPZ                                                         ~7, ->19
   39    11    >   INIT_FCALL_BY_NAME                                           'getAllInfo'
         12        CHECK_FUNC_ARG                                               
         13        FETCH_DIM_FUNC_ARG                                   $8      !0, 'Ancestors'
         14        FETCH_DIM_FUNC_ARG                                   $9      $8, 'BrowseNode'
         15        SEND_FUNC_ARG                                                $9
         16        SEND_VAR_EX                                                  !1
         17        DO_FCALL                                          0  $10     
         18      > RETURN                                                       $10
   41    19    > > RETURN                                                       !1
   43    20*     > RETURN                                                       null

End of function getallinfo

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.4 ms | 3046 KiB | 15 Q