3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 'a,b,c,d,e,f'; function g($a) { echo 'in'; yield from preg_split('/,/' , $a); echo 'ou'; }; foreach (g($a) as $t) { var_dump($t); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/r6lCE
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a, !1 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'a%2Cb%2Cc%2Cd%2Ce%2Cf'
    6     1        INIT_FCALL                                               'g'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $3      
          4      > FE_RESET_R                                       $4      $3, ->10
          5    > > FE_FETCH_R                                               $4, !1, ->10
          6    >   INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
          9      > JMP                                                      ->5
         10    >   FE_FREE                                                  $4
         11      > RETURN                                                   1

Function g:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/r6lCE
function name:  g
number of ops:  11
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
          2        ECHO                                                     'in'
          3        INIT_FCALL                                               'preg_split'
          4        SEND_VAL                                                 '%2F%2C%2F'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $1      
          7        YIELD_FROM                                       ~2      $1
          8        FREE                                                     ~2
          9        ECHO                                                     'ou'
         10      > GENERATOR_RETURN                                         

End of function g

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.41 ms | 1389 KiB | 18 Q