3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [['Id' => 1], ['As' => 2], ['Id' => 4], 'el']; array_walk($arr, function($v, $k) use ($arr) { if (!is_array($v) || empty($v['Id'])) { unset ($arr[$k]); } // echo $i .' '.$j.PHP_EOL; }); print_r($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XQYEf
function name:  (null)
number of ops:  11
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'array_walk'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FXQYEf%3A5%240'
          4        BIND_LEXICAL                                             ~2, !0
   10     5        SEND_VAL                                                 ~2
          6        DO_ICALL                                                 
   12     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FXQYEf%3A5%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
Branch analysis from position: 8
filename:       /in/XQYEf
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $v, !1 = $k, !2 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
    6     3        TYPE_CHECK                                  128  ~3      !0
          4        BOOL_NOT                                         ~4      ~3
          5      > JMPNZ_EX                                         ~4      ~4, ->8
          6    >   ISSET_ISEMPTY_DIM_OBJ                         1  ~5      !0, 'Id'
          7        BOOL                                             ~4      ~5
          8    > > JMPZ                                                     ~4, ->10
    7     9    >   UNSET_DIM                                                !2, !1
   10    10    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FXQYEf%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.21 ms | 1395 KiB | 17 Q