3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hasNonEmptyArray(array $array): bool { $iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($array)); foreach ($iterator as $k => $v) { echo "Found element $k\n"; return true; } return false; } $array = [ [ 'one' => [], 'two' => [ 'a' => [ 'foo' => [], ], 'b' => [] ], 'three' => [ 'c' => [ 'fizz' => 'buzz' ] ] ] ]; var_export(hasNonEmptyArray($array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tLarL
function name:  (null)
number of ops:  8
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, <array>
   30     1        INIT_FCALL                                               'var_export'
          2        INIT_FCALL                                               'hasnonemptyarray'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function hasnonemptyarray:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 18
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/tLarL
function name:  hasNonEmptyArray
number of ops:  22
compiled vars:  !0 = $array, !1 = $iterator, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        NEW                                              $4      'RecursiveIteratorIterator'
          2        NEW                                              $5      'RecursiveArrayIterator'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $5
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $4
    6     8      > FE_RESET_R                                       $9      !1, ->18
          9    > > FE_FETCH_R                                       ~10     $9, !2, ->18
         10    >   ASSIGN                                                   !3, ~10
    7    11        ROPE_INIT                                     3  ~13     'Found+element+'
         12        ROPE_ADD                                      1  ~13     ~13, !3
         13        ROPE_END                                      2  ~12     ~13, '%0A'
         14        ECHO                                                     ~12
    8    15        FE_FREE                                                  $9
         16      > RETURN                                                   <true>
    6    17*       JMP                                                      ->9
         18    >   FE_FREE                                                  $9
   10    19      > RETURN                                                   <false>
   11    20*       VERIFY_RETURN_TYPE                                       
         21*     > RETURN                                                   null

End of function hasnonemptyarray

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.14 ms | 1013 KiB | 15 Q