3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generator_eval(Generator $gen) { foreach ($gen as $k => $v) {} } function uppercase(Traversable $in) { foreach ($in as $word) { yield strtoupper($word); } } function each_println(Traversable $in) { foreach ($in as $line) { echo "$line\n"; } } each_println(uppercase(new ArrayIterator(["foo", "bar", "baz"])));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pvBBr
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_FCALL                                               'each_println'
          1        INIT_FCALL                                               'uppercase'
          2        NEW                                              $0      'ArrayIterator'
          3        SEND_VAL_EX                                              <array>
          4        DO_FCALL                                      0          
          5        SEND_VAR                                                 $0
          6        DO_FCALL                                      0  $2      
          7        SEND_VAR                                                 $2
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Function generator_eval:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 5
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/pvBBr
function name:  generator_eval
number of ops:  7
compiled vars:  !0 = $gen, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1      > FE_RESET_R                                       $3      !0, ->5
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->5
          3    >   ASSIGN                                                   !2, ~4
          4      > JMP                                                      ->2
          5    >   FE_FREE                                                  $3
    6     6      > RETURN                                                   null

End of function generator_eval

Function uppercase:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 9
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 9
filename:       /in/pvBBr
function name:  uppercase
number of ops:  11
compiled vars:  !0 = $in, !1 = $word
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
   10     2      > FE_RESET_R                                       $2      !0, ->9
          3    > > FE_FETCH_R                                               $2, !1, ->9
   11     4    >   INIT_FCALL                                               'strtoupper'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $3      
          7        YIELD                                                    $3
   10     8      > JMP                                                      ->3
          9    >   FE_FREE                                                  $2
   13    10      > GENERATOR_RETURN                                         

End of function uppercase

Function each_println:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 7
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/pvBBr
function name:  each_println
number of ops:  9
compiled vars:  !0 = $in, !1 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1      > FE_RESET_R                                       $2      !0, ->7
          2    > > FE_FETCH_R                                               $2, !1, ->7
   18     3    >   NOP                                                      
          4        FAST_CONCAT                                      ~3      !1, '%0A'
          5        ECHO                                                     ~3
   17     6      > JMP                                                      ->2
          7    >   FE_FREE                                                  $2
   20     8      > RETURN                                                   null

End of function each_println

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.51 ms | 1394 KiB | 17 Q