3v4l.org

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

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

End of function generator

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.22 ms | 1401 KiB | 16 Q