3v4l.org

run code in 300+ PHP versions simultaneously
<?php function returnItems($items) { foreach($items as $item) { 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/hE6jq
function name:  (null)
number of ops:  24
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'array_push'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'ok'
          4        DO_ICALL                                                 
   12     5        INIT_FCALL                                               'array_push'
          6        SEND_REF                                                 !0
          7        SEND_VAL                                                 'dok'
          8        DO_ICALL                                                 
   13     9        INIT_FCALL                                               'array_push'
         10        SEND_REF                                                 !0
         11        SEND_VAL                                                 'odk'
         12        DO_ICALL                                                 
   14    13        INIT_FCALL                                               'array_push'
         14        SEND_REF                                                 !0
         15        SEND_VAL                                                 'okd'
         16        DO_ICALL                                                 
   16    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 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 6
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 6
filename:       /in/hE6jq
function name:  returnItems
number of ops:  8
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      > FE_RESET_R                                       $2      !0, ->6
          3    > > FE_FETCH_R                                               $2, !1, ->6
    5     4    >   YIELD                                                    !1
    4     5      > JMP                                                      ->3
          6    >   FE_FREE                                                  $2
    7     7      > GENERATOR_RETURN                                         

End of function returnitems

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.23 ms | 1399 KiB | 18 Q