3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array( 1, 2, 3, 4, 5, 6 ); echo function () use ($arr) { foreach ($arr as $integerValue) { yield $integerValue; } };
based on MpO3b
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/HFv1j
function name:  (null)
number of ops:  4
compiled vars:  !0 = $arr
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   ASSIGN                                                   !0, <array>
   6     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FHFv1j0x7f296c6c208b'
  10     2        ECHO                                                     ~2
         3      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FHFv1j0x7f296c6c208b:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
Jump found. Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
Jump found. Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 6
Jump found. Position 1 = -2
Branch analysis from position: 6
filename:       /in/HFv1j
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $arr, !1 = $integerValue
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   6     0  E >   FETCH_R                      static              $2      'arr'
         1        ASSIGN                                                   !0, $2
   7     2      > FE_RESET_R                                       $4      !0, ->6
         3    > > FE_FETCH_R                                               $4, !1, ->6
   8     4    >   YIELD                                                    !1
         5      > JMP                                                      ->3
         6    >   FE_FREE                                                  $4
  10     7      > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2FHFv1j0x7f296c6c208b

Generated using Vulcan Logic Dumper, using php 7.2.0