3v4l.org

run code in 300+ PHP versions simultaneously
<?php function returnItems($items) { foreach($items as $item) { echo $item . "\n"; yield $item; } } $arr = []; array_push($arr, "ok"); array_push($arr, "dok"); array_push($arr, "odk"); array_push($arr, "okd"); print_r(iterator_to_array(returnItems($arr)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mT1EQ
function name:  (null)
number of ops:  27
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   14     1        INIT_FCALL                                               'array_push'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'ok'
          4        DO_ICALL                                                 
   15     5        INIT_FCALL                                               'array_push'
          6        SEND_REF                                                 !0
          7        SEND_VAL                                                 'dok'
          8        DO_ICALL                                                 
   16     9        INIT_FCALL                                               'array_push'
         10        SEND_REF                                                 !0
         11        SEND_VAL                                                 'odk'
         12        DO_ICALL                                                 
   17    13        INIT_FCALL                                               'array_push'
         14        SEND_REF                                                 !0
         15        SEND_VAL                                                 'okd'
         16        DO_ICALL                                                 
   19    17        INIT_FCALL                                               'print_r'
         18        INIT_FCALL                                               'iterator_to_array'
         19        INIT_FCALL                                               'returnitems'
         20        SEND_VAR                                                 !0
         21        DO_FCALL                                      0  $6      
         22        SEND_VAR                                                 $6
         23        DO_ICALL                                         $7      
         24        SEND_VAR                                                 $7
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Function returnitems:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 8
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 8
filename:       /in/mT1EQ
function name:  returnItems
number of ops:  10
compiled vars:  !0 = $items, !1 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
    5     2      > FE_RESET_R                                       $2      !0, ->8
          3    > > FE_FETCH_R                                               $2, !1, ->8
    6     4    >   CONCAT                                           ~3      !1, '%0A'
          5        ECHO                                                     ~3
    8     6        YIELD                                                    !1
    5     7      > JMP                                                      ->3
          8    >   FE_FREE                                                  $2
   10     9      > GENERATOR_RETURN                                         

End of function returnitems

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.54 ms | 1402 KiB | 20 Q