3v4l.org

run code in 300+ PHP versions simultaneously
<?php $blah= array(array('a'=> 1, 'b' => array('inner' => 2))); function _test(&$test) { foreach ($test as $key => $value) { if (is_array($value) === false) continue; $clone = array(); $clone = array_merge($clone, $test); unset($clone[$key]['a']); 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/C2Foh
function name:  (null)
number of ops:  8
compiled vars:  !0 = $blah
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   17     1        INIT_FCALL                                               '_test'
          2        SEND_REF                                                 !0
          3        DO_FCALL                                      0          
   19     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

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

End of function _test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
198.37 ms | 1403 KiB | 18 Q