3v4l.org

run code in 300+ PHP versions simultaneously
<?php $generator = (static function ($s) { yield from $s; })([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/BeK97
function name:  (null)
number of ops:  15
compiled vars:  !0 = $generator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FBeK97%3A3%240'
    5     1        INIT_DYNAMIC_CALL                                        ~1
          2        SEND_VAL_EX                                              <array>
          3        DO_FCALL                                      0  $2      
    3     4        ASSIGN                                                   !0, $2
    7     5        INIT_METHOD_CALL                                         !0, 'next'
          6        DO_FCALL                                      0          
    8     7        INIT_METHOD_CALL                                         !0, 'next'
          8        DO_FCALL                                      0          
    9     9        INIT_METHOD_CALL                                         !0, 'rewind'
         10        DO_FCALL                                      0          
   10    11        INIT_METHOD_CALL                                         !0, 'current'
         12        DO_FCALL                                      0  $7      
         13        ECHO                                                     $7
         14      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FBeK97%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
193.3 ms | 1393 KiB | 13 Q