3v4l.org

run code in 300+ PHP versions simultaneously
<?php $empty = function(&$v) use (&$empty) { if (is_array($v)) { $v = array_filter($v, $empty); } elseif (!empty($v)) { $v = $v . 'modified'; } return !empty($v); }; $a = ['',['',['a', 'b'],'c'],'d']; $b = $a; var_dump(array_filter($b, $empty)); ?><hr><?php var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/irv2H
function name:  (null)
number of ops:  17
compiled vars:  !0 = $empty, !1 = $a, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Firv2H%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_FCALL                                               'array_filter'
          7        SEND_VAR                                                 !2
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $7      
         10        SEND_VAR                                                 $7
         11        DO_ICALL                                                 
   19    12        ECHO                                                     '%3Chr%3E'
   20    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Firv2H%3A3%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/irv2H
function name:  {closure}
number of ops:  19
compiled vars:  !0 = $v, !1 = $empty
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                                                     ~2, ->10
    7     4    >   INIT_FCALL                                               'array_filter'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $3      
          8        ASSIGN                                                   !0, $3
          9      > JMP                                                      ->15
    9    10    >   ISSET_ISEMPTY_CV                                 ~5      !0
         11        BOOL_NOT                                         ~6      ~5
         12      > JMPZ                                                     ~6, ->15
   11    13    >   CONCAT                                           ~7      !0, 'modified'
         14        ASSIGN                                                   !0, ~7
   13    15    >   ISSET_ISEMPTY_CV                                 ~9      !0
         16        BOOL_NOT                                         ~10     ~9
         17      > RETURN                                                   ~10
   14    18*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.74 ms | 1400 KiB | 17 Q