3v4l.org

run code in 300+ PHP versions simultaneously
<?php $generator = (static function () { yield from [1,2,3]; })(); $generator->next(); $generator->next(); $generator->rewind(); echo $generator->current(); # 3
based on 71sgW
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NZ77U
function name:  (null)
number of ops:  14
compiled vars:  !0 = $generator
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FNZ77U0x7f8f794792e2'
   5     1        INIT_DYNAMIC_CALL                                        ~1
         2        DO_FCALL                                      0  $2      
         3        ASSIGN                                                   !0, $2
   7     4        INIT_METHOD_CALL                                         !0, 'next'
         5        DO_FCALL                                      0          
   8     6        INIT_METHOD_CALL                                         !0, 'next'
         7        DO_FCALL                                      0          
   9     8        INIT_METHOD_CALL                                         !0, 'rewind'
         9        DO_FCALL                                      0          
  10    10        INIT_METHOD_CALL                                         !0, 'current'
        11        DO_FCALL                                      0  $7      
        12        ECHO                                                     $7
        13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FNZ77U0x7f8f794792e2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/NZ77U
function name:  {closure}
number of ops:  4
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   DECLARE_CLASS                                            
   4     1        YIELD_FROM                                       ~0      <array>
         2        FREE                                                     ~0
   5     3      > GENERATOR_RETURN                                         

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

Generated using Vulcan Logic Dumper, using php 7.4.0