3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen() { yield 42; }; $xs = gen(); var_dump($xs->current()); var_dump($xs->valid()); $xs->next(); var_dump($xs->valid()); var_dump($xs->current()); foreach ($xs as $x) { var_dump($x); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 31
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 31
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/dj5cV
function name:  (null)
number of ops:  33
compiled vars:  !0 = $xs, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'gen'
          1        DO_FCALL                                      0  $2      
          2        ASSIGN                                                   !0, $2
    5     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'current'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
    6     8        INIT_FCALL                                               'var_dump'
          9        INIT_METHOD_CALL                                         !0, 'valid'
         10        DO_FCALL                                      0  $6      
         11        SEND_VAR                                                 $6
         12        DO_ICALL                                                 
    7    13        INIT_METHOD_CALL                                         !0, 'next'
         14        DO_FCALL                                      0          
    8    15        INIT_FCALL                                               'var_dump'
         16        INIT_METHOD_CALL                                         !0, 'valid'
         17        DO_FCALL                                      0  $9      
         18        SEND_VAR                                                 $9
         19        DO_ICALL                                                 
    9    20        INIT_FCALL                                               'var_dump'
         21        INIT_METHOD_CALL                                         !0, 'current'
         22        DO_FCALL                                      0  $11     
         23        SEND_VAR                                                 $11
         24        DO_ICALL                                                 
   11    25      > FE_RESET_R                                       $13     !0, ->31
         26    > > FE_FETCH_R                                               $13, !1, ->31
         27    >   INIT_FCALL                                               'var_dump'
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                                 
         30      > JMP                                                      ->26
         31    >   FE_FREE                                                  $13
         32      > RETURN                                                   1

Function gen:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/dj5cV
function name:  gen
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   GENERATOR_CREATE                                         
          1        YIELD                                                    42
          2      > GENERATOR_RETURN                                         

End of function gen

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.05 ms | 1399 KiB | 16 Q