3v4l.org

run code in 300+ PHP versions simultaneously
<?php $afr = function(&$v) use (&$afr) { if (is_array($v)) { foreach($v as $key=>$val) { if (empty($val)) unset($v[$key]); if (is_array($val)) $v[$key] = $afr($val); } } return $v; }; $a = ['',['',['a', 'b'],'c'],'d']; $b = $a; var_dump($afr($b)); ?><hr><?php var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VChHV
function name:  (null)
number of ops:  16
compiled vars:  !0 = $afr, !1 = $a, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FVChHV%3A3%240'
          1        BIND_LEXICAL                                             ~3, !0
          2        ASSIGN                                                   !0, ~3
   16     3        ASSIGN                                                   !1, <array>
   17     4        ASSIGN                                                   !2, !1
   18     5        INIT_FCALL                                               'var_dump'
          6        INIT_DYNAMIC_CALL                                        !0
          7        SEND_VAR_EX                                              !2
          8        DO_FCALL                                      0  $7      
          9        SEND_VAR                                                 $7
         10        DO_ICALL                                                 
   19    11        ECHO                                                     '%3Chr%3E'
   20    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FVChHV%3A3%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 18
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 17
Branch analysis from position: 10
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
Branch analysis from position: 19
filename:       /in/VChHV
function name:  {closure}
number of ops:  21
compiled vars:  !0 = $v, !1 = $afr, !2 = $val, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    5     2        TYPE_CHECK                                  128          !0
          3      > JMPZ                                                     ~4, ->19
    7     4    > > FE_RESET_R                                       $5      !0, ->18
          5    > > FE_FETCH_R                                       ~6      $5, !2, ->18
          6    >   ASSIGN                                                   !3, ~6
    9     7        ISSET_ISEMPTY_CV                                         !2
          8      > JMPZ                                                     ~8, ->10
          9    >   UNSET_DIM                                                !0, !3
   10    10    >   TYPE_CHECK                                  128          !2
         11      > JMPZ                                                     ~9, ->17
         12    >   INIT_DYNAMIC_CALL                                        !1
         13        SEND_VAR_EX                                              !2
         14        DO_FCALL                                      0  $11     
         15        ASSIGN_DIM                                               !0, !3
         16        OP_DATA                                                  $11
    7    17    > > JMP                                                      ->5
         18    >   FE_FREE                                                  $5
   13    19    > > RETURN                                                   !0
   14    20*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FVChHV%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.77 ms | 1400 KiB | 15 Q