3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ '1' => true, ['2' => false, '4' => true], '3' => true ]; $matches = []; array_walk_recursive($array, function ($value, $key) use (&$matches) { if ($value === true) { $matches[] = $key; } }); print_r($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ksq4F
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
    9     2        INIT_FCALL                                               'array_walk_recursive'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        BIND_LEXICAL                                             ~4, !1
   13     6        SEND_VAL                                                 ~4
    9     7        DO_ICALL                                                 
   15     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/Ksq4F
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $value, !1 = $key, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
   10     3        TYPE_CHECK                                    8          !0
          4      > JMPZ                                                     ~3, ->7
   11     5    >   ASSIGN_DIM                                               !2
          6        OP_DATA                                                  !1
   13     7    > > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.07 ms | 1001 KiB | 15 Q