3v4l.org

run code in 500+ PHP versions simultaneously
<?php function generator(): iterable { yield 1; yield 2; yield 3; } $iterable = generator(); var_dump($iterable); var_dump(array(...$iterable));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L3JNH
function name:  (null)
number of ops:  12
compiled vars:  !0 = $iterable
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                                   'generator'
          1        DO_FCALL                                          0  $1      
          2        ASSIGN                                                       !0, $1
   13     3        INIT_FCALL                                                   'var_dump'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                                     
   14     6        INIT_FCALL                                                   'var_dump'
          7        INIT_ARRAY                                           ~4      
          8        ADD_ARRAY_UNPACK                                     ~4      !0
          9        SEND_VAL                                                     ~4
         10        DO_ICALL                                                     
         11      > RETURN                                                       1

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

End of function generator

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
141.81 ms | 2036 KiB | 15 Q