3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen1() { $a = yield 5; $b = ($a + yield 2) - ($a + yield 1) * yield 3; yield $b; } $g = gen1(); $g->next(); var_dump($g->current());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DsdaR
function name:  (null)
number of ops:  11
compiled vars:  !0 = $g
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'gen1'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   10     3        INIT_METHOD_CALL                                         !0, 'next'
          4        DO_FCALL                                      0          
   11     5        INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !0, 'current'
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function gen1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/DsdaR
function name:  gen1
number of ops:  13
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        YIELD                                            $2      5
          2        ASSIGN                                                   !0, $2
    5     3        YIELD                                            $4      2
          4        ADD                                              ~5      !0, $4
          5        YIELD                                            $6      1
          6        ADD                                              ~7      !0, $6
          7        YIELD                                            $8      3
          8        MUL                                              ~9      $8, ~7
          9        SUB                                              ~10     ~5, ~9
         10        ASSIGN                                                   !1, ~10
    6    11        YIELD                                                    !1
    7    12      > GENERATOR_RETURN                                         

End of function gen1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.26 ms | 1398 KiB | 16 Q