3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( 1, 2, 3, 4, 5, 6 ); function () use ($arr) { yield $arr[0]; };
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X121g
function name:  (null)
number of ops:  5
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FX121g%3A6%240'
          2        BIND_LEXICAL                                             ~2, !0
    8     3        FREE                                                     ~2
          4      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FX121g%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/X121g
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   GENERATOR_CREATE                                         
          1        BIND_STATIC                                              !0
    7     2        FETCH_DIM_R                                      ~1      !0, 0
          3        YIELD                                                    ~1
    8     4      > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2FX121g%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.62 ms | 1393 KiB | 13 Q