3v4l.org

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

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

End of function uppercase

Function %00%7Bclosure%7D%2Fin%2FNsGiX%3A22%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/NsGiX
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   GENERATOR_CREATE                                         
   23     1      > JMP                                                      ->8
   24     2    >   YIELD                                            $1      
          3        ASSIGN                                                   !0, $1
   25     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
   27     9    > > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2FNsGiX%3A22%240

Class Pipe: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.6 ms | 1403 KiB | 17 Q