3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array( array( array(1), array(), ), array(1), array(), array(2), ); $c = function($a) use (&$c) { return is_array($a) ? array_filter(array_map($c, $a), function ($b) { return !(is_array($b) && empty($b)); }) : $a; }; var_dump($c($a));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FtYf0
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   13     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FFtYf0%3A13%240'
          2        BIND_LEXICAL                                             ~3, !1
          3        ASSIGN                                                   !1, ~3
   17     4        INIT_FCALL                                               'var_dump'
          5        INIT_DYNAMIC_CALL                                        !1
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0  $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FFtYf0%3A13%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FtYf0
function name:  {closure}
number of ops:  18
compiled vars:  !0 = $a, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   14     2        TYPE_CHECK                                  128          !0
          3      > JMPZ                                                     ~2, ->15
          4    >   INIT_FCALL                                               'array_filter'
          5        INIT_FCALL                                               'array_map'
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $3      
          9        SEND_VAR                                                 $3
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FFtYf0%3A14%241'
         11        SEND_VAL                                                 ~4
         12        DO_ICALL                                         $5      
         13        QM_ASSIGN                                        ~6      $5
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~6      !0
         16    > > RETURN                                                   ~6
   15    17*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FFtYf0%3A13%240

Function %00%7Bclosure%7D%2Fin%2FFtYf0%3A14%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/FtYf0
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        TYPE_CHECK                                  128  ~1      !0
          2      > JMPZ_EX                                          ~1      ~1, ->5
          3    >   ISSET_ISEMPTY_CV                                 ~2      !0
          4        BOOL                                             ~1      ~2
          5    >   BOOL_NOT                                         ~3      ~1
          6      > RETURN                                                   ~3
          7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FFtYf0%3A14%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.09 ms | 1400 KiB | 19 Q