3v4l.org

run code in 500+ PHP versions simultaneously
<?php $generator = (static function () { yield from [1,2,3]; })(); $generator->next(); $generator->next(); $generator->rewind(); echo $generator->current(); # 3
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                              ~1      [0]
    5     1        INIT_DYNAMIC_CALL                                            ~1
          2        DO_FCALL                                          0  $2      
    3     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


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

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.38 ms | 3317 KiB | 13 Q