3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Pipe { var $stderr; } function generator_eval(Generator $gen) { foreach ($gen as $k => $v) {} } function words() { foreach (["foo", "bar", "baz"] as $word) { yield $word; } } function uppercase(Traversable $in, Generator $error) { foreach ($in as $word) { yield strtoupper($word); } } function each_println(Traversable $in) { foreach ($in as $line) { echo "$line\n"; } } $stderr = function() { for (;;) { $error = (yield); echo "Error! $error\n"; } }; each_println(uppercase(words(), $stderr()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dkvK6
function name:  (null)
number of ops:  14
compiled vars:  !0 = $stderr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FdkvK6%3A34%240'
          1        ASSIGN                                                   !0, ~1
   41     2        INIT_FCALL                                               'each_println'
          3        INIT_FCALL                                               'uppercase'
          4        INIT_FCALL                                               'words'
          5        DO_FCALL                                      0  $3      
          6        SEND_VAR                                                 $3
          7        INIT_DYNAMIC_CALL                                        !0
          8        DO_FCALL                                      0  $4      
          9        SEND_VAR                                                 $4
         10        DO_FCALL                                      0  $5      
         11        SEND_VAR                                                 $5
         12        DO_FCALL                                      0          
         13      > 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/dkvK6
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
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     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
   11     6      > RETURN                                                   null

End of function generator_eval

Function words:
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 = 161) Position 1 = -2
Branch analysis from position: 5
filename:       /in/dkvK6
function name:  words
number of ops:  7
compiled vars:  !0 = $word
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   GENERATOR_CREATE                                         
   15     1      > FE_RESET_R                                       $1      <array>, ->5
          2    > > FE_FETCH_R                                               $1, !0, ->5
   16     3    >   YIELD                                                    !0
   15     4      > JMP                                                      ->2
          5    >   FE_FREE                                                  $1
   18     6      > GENERATOR_RETURN                                         

End of function words

Function uppercase:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 10
filename:       /in/dkvK6
function name:  uppercase
number of ops:  12
compiled vars:  !0 = $in, !1 = $error, !2 = $word
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        GENERATOR_CREATE                                         
   22     3      > FE_RESET_R                                       $3      !0, ->10
          4    > > FE_FETCH_R                                               $3, !2, ->10
   23     5    >   INIT_FCALL                                               'strtoupper'
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $4      
          8        YIELD                                                    $4
   22     9      > JMP                                                      ->4
         10    >   FE_FREE                                                  $3
   25    11      > 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/dkvK6
function name:  each_println
number of ops:  9
compiled vars:  !0 = $in, !1 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
   29     1      > FE_RESET_R                                       $2      !0, ->7
          2    > > FE_FETCH_R                                               $2, !1, ->7
   30     3    >   NOP                                                      
          4        FAST_CONCAT                                      ~3      !1, '%0A'
          5        ECHO                                                     ~3
   29     6      > JMP                                                      ->2
          7    >   FE_FREE                                                  $2
   32     8      > RETURN                                                   null

End of function each_println

Function %00%7Bclosure%7D%2Fin%2FdkvK6%3A34%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 2
Branch analysis from position: 9
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 2
Branch analysis from position: 9
Branch analysis from position: 2
filename:       /in/dkvK6
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   GENERATOR_CREATE                                         
   35     1      > JMP                                                      ->8
   36     2    >   YIELD                                            $1      
          3        ASSIGN                                                   !0, $1
   37     4        ROPE_INIT                                     3  ~4      'Error%21+'
          5        ROPE_ADD                                      1  ~4      ~4, !0
          6        ROPE_END                                      2  ~3      ~4, '%0A'
          7        ECHO                                                     ~3
          8    > > JMPNZ                                                    <true>, ->2
   39     9    > > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2FdkvK6%3A34%240

Class Pipe: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.05 ms | 1407 KiB | 18 Q