3v4l.org

run code in 300+ PHP versions simultaneously
<?php $blah= array(array('a'=> 1, 'b' => array('inner' => 2))); $blank = array(); function _test(&$test, &$blank) { foreach ($test as $key => $value) { if (is_array($value) === false) continue; $clonedArray = array(); $clonedArray = array_merge($clonedArray, $test); unset($clonedArray[$key]['a']); $blank[$key] = $clonedArray; if (is_array($value) === true){ _test($test[$key]); } } } _test($blah); var_dump($blah);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YpAUG
function name:  (null)
number of ops:  9
compiled vars:  !0 = $blah, !1 = $blank
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
   19     2        INIT_FCALL                                               '_test'
          3        SEND_REF                                                 !0
          4        DO_FCALL                                      0          
   21     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function _test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 28
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 28
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 27
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/YpAUG
function name:  _test
number of ops:  30
compiled vars:  !0 = $test, !1 = $blank, !2 = $value, !3 = $key, !4 = $clonedArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2      > FE_RESET_R                                       $5      !0, ->28
          3    > > FE_FETCH_R                                       ~6      $5, !2, ->28
          4    >   ASSIGN                                                   !3, ~6
    7     5        TYPE_CHECK                                  128  ~8      !2
          6        TYPE_CHECK                                    4          ~8
          7      > JMPZ                                                     ~9, ->9
          8    > > JMP                                                      ->3
    8     9    >   ASSIGN                                                   !4, <array>
    9    10        INIT_FCALL                                               'array_merge'
         11        SEND_VAR                                                 !4
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $11     
         14        ASSIGN                                                   !4, $11
   10    15        FETCH_DIM_UNSET                                  $13     !4, !3
         16        UNSET_DIM                                                $13, 'a'
   11    17        ASSIGN_DIM                                               !1, !3
         18        OP_DATA                                                  !4
   13    19        TYPE_CHECK                                  128  ~15     !2
         20        TYPE_CHECK                                    8          ~15
         21      > JMPZ                                                     ~16, ->27
   14    22    >   INIT_FCALL_BY_NAME                                       '_test'
         23        CHECK_FUNC_ARG                                           
         24        FETCH_DIM_FUNC_ARG                               $17     !0, !3
         25        SEND_FUNC_ARG                                            $17
         26        DO_FCALL                                      0          
    6    27    > > JMP                                                      ->3
         28    >   FE_FREE                                                  $5
   17    29      > RETURN                                                   null

End of function _test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.55 ms | 947 KiB | 19 Q