3v4l.org

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

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

End of function returnitems

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.77 ms | 1399 KiB | 18 Q