3v4l.org

run code in 300+ PHP versions simultaneously
<?php $execute = function ($n){ foreach($n as $a) { yield $a; } }; if( !is_array( $execute ) && !$items instanceof Traversable ) { echo 'ddd'; } else { echo 'aaa'; } /*foreach(execute([1,2,5]) as $n){ echo $n.PHP_EOL; }*/
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/TrDh1
function name:  (null)
number of ops:  13
compiled vars:  !0 = $execute, !1 = $items
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FTrDh1%3A2%240'
          1        ASSIGN                                                   !0, ~2
    8     2        TYPE_CHECK                                  128  ~4      !0
          3        BOOL_NOT                                         ~5      ~4
          4      > JMPZ_EX                                          ~5      ~5, ->8
          5    >   INSTANCEOF                                       ~6      !1, 'Traversable'
          6        BOOL_NOT                                         ~7      ~6
          7        BOOL                                             ~5      ~7
          8    > > JMPZ                                                     ~5, ->11
    9     9    >   ECHO                                                     'ddd'
         10      > JMP                                                      ->12
   11    11    >   ECHO                                                     'aaa'
   16    12    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FTrDh1%3A2%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 6
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 6
filename:       /in/TrDh1
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $n, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
    3     2      > FE_RESET_R                                       $2      !0, ->6
          3    > > FE_FETCH_R                                               $2, !1, ->6
    4     4    >   YIELD                                                    !1
    3     5      > JMP                                                      ->3
          6    >   FE_FREE                                                  $2
    6     7      > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2FTrDh1%3A2%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.22 ms | 1395 KiB | 13 Q