3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'test' => [ 'access' => 111, 'aa' => [ 'access' => 222, 'bb' => 333 ], ], 'access' => 444, 'value' => 555 ]; function removeIfNotArrayAndNotSiblingOfAccess($array) { foreach ($array as $key => &$value) { if (is_array($value)) { $value = (__FUNCTION__)($value); } elseif ($key != 'access') { unset($array[$key]); } } return $array; } var_export(removeIfNotArrayAndNotSiblingOfAccess($array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mYLHT
function name:  (null)
number of ops:  8
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   26     1        INIT_FCALL                                               'var_export'
          2        INIT_FCALL                                               'removeifnotarrayandnotsiblingofaccess'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function removeifnotarrayandnotsiblingofaccess:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 15
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/mYLHT
function name:  removeIfNotArrayAndNotSiblingOfAccess
number of ops:  18
compiled vars:  !0 = $array, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1      > FE_RESET_RW                                      $3      !0, ->15
          2    > > FE_FETCH_RW                                      ~4      $3, !1, ->15
          3    >   ASSIGN                                                   !2, ~4
   17     4        TYPE_CHECK                                  128          !1
          5      > JMPZ                                                     ~6, ->11
   18     6    >   INIT_FCALL_BY_NAME                                       'removeIfNotArrayAndNotSiblingOfAccess'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0  $7      
          9        ASSIGN                                                   !1, $7
   17    10      > JMP                                                      ->14
   19    11    >   IS_NOT_EQUAL                                             !2, 'access'
         12      > JMPZ                                                     ~9, ->14
   20    13    >   UNSET_DIM                                                !0, !2
   16    14    > > JMP                                                      ->2
         15    >   FE_FREE                                                  $3
   23    16      > RETURN                                                   !0
   24    17*     > RETURN                                                   null

End of function removeifnotarrayandnotsiblingofaccess

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.42 ms | 1008 KiB | 15 Q