3v4l.org

run code in 300+ PHP versions simultaneously
<?php $generator = static function (): iterable { yield 'a' => 'b'; yield new stdClass => 'c'; }; var_export(iterator_to_array($generator()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g2hKC
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
    8     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/g2hKC
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                                                    'b', 'a'
    5     2        NEW                                              $1      'stdClass'
          3        DO_FCALL                                      0          
          4        YIELD                                                    'c', $1
    6     5      > GENERATOR_RETURN                                         

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.98 ms | 1000 KiB | 15 Q