3v4l.org

run code in 300+ PHP versions simultaneously
<?php $generator = static function (): iterable { yield 0 => 1; yield 'a' => 2; yield null => 3; yield true => 4; }; var_export(iterator_to_array($generator()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QgQWa
function name:  (null)
number of ops:  11
compiled vars:  !0 = $generator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                          ~1      [0]
          1        ASSIGN                                                   !0, ~1
   10     2        INIT_FCALL                                               'var_export'
          3        INIT_FCALL                                               'iterator_to_array'
          4        INIT_DYNAMIC_CALL                                        !0
          5        DO_FCALL                                      0  $3      
          6        SEND_VAR                                                 $3
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
         10      > 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/QgQWa
function name:  {closure}
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        YIELD                                                    1, 0
    5     2        YIELD                                                    2, 'a'
    6     3        YIELD                                                    3, null
    7     4        YIELD                                                    4, <true>
    8     5      > GENERATOR_RETURN                                         

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.29 ms | 1000 KiB | 15 Q