3v4l.org

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

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/UHu93
function name:  uppercase
number of ops:  11
compiled vars:  !0 = $in, !1 = $word
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
    5     2      > FE_RESET_R                                       $2      !0, ->9
          3    > > FE_FETCH_R                                               $2, !1, ->9
    6     4    >   INIT_FCALL                                               'strtoupper'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $3      
          7        YIELD                                                    $3
    5     8      > JMP                                                      ->3
          9    >   FE_FREE                                                  $2
    8    10      > GENERATOR_RETURN                                         

End of function uppercase

Function reverse:
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/UHu93
function name:  reverse
number of ops:  11
compiled vars:  !0 = $in, !1 = $word
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
   12     2      > FE_RESET_R                                       $2      !0, ->9
          3    > > FE_FETCH_R                                               $2, !1, ->9
   13     4    >   INIT_FCALL                                               'strrev'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $3      
          7        YIELD                                                    $3
   12     8      > JMP                                                      ->3
          9    >   FE_FREE                                                  $2
   15    10      > GENERATOR_RETURN                                         

End of function reverse

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/UHu93
function name:  each_println
number of ops:  9
compiled vars:  !0 = $in, !1 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1      > FE_RESET_R                                       $2      !0, ->7
          2    > > FE_FETCH_R                                               $2, !1, ->7
   20     3    >   NOP                                                      
          4        FAST_CONCAT                                      ~3      !1, '%0A'
          5        ECHO                                                     ~3
   19     6      > JMP                                                      ->2
          7    >   FE_FREE                                                  $2
   22     8      > RETURN                                                   null

End of function each_println

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.4 ms | 1403 KiB | 20 Q