3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() { //echo $data; $foo = foo(); while($data = yield) $foo->send($data . ' je kokot'); } function foo() { while($data = yield) echo $data; } $d = test(); var_dump($d); $d->send("Lukas"); $d->send("Milan");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c18Dq
function name:  (null)
number of ops:  13
compiled vars:  !0 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   25     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   27     6        INIT_METHOD_CALL                                         !0, 'send'
          7        SEND_VAL_EX                                              'Lukas'
          8        DO_FCALL                                      0          
   28     9        INIT_METHOD_CALL                                         !0, 'send'
         10        SEND_VAL_EX                                              'Milan'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 5
Branch analysis from position: 12
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 5
Branch analysis from position: 12
Branch analysis from position: 5
filename:       /in/c18Dq
function name:  test
number of ops:  13
compiled vars:  !0 = $foo, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    9     1        INIT_FCALL_BY_NAME                                       'foo'
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !0, $2
   11     4      > JMP                                                      ->9
   12     5    >   INIT_METHOD_CALL                                         !0, 'send'
          6        CONCAT                                           ~4      !1, '+je+kokot'
          7        SEND_VAL_EX                                              ~4
          8        DO_FCALL                                      0          
   11     9    >   YIELD                                            $6      
         10        ASSIGN                                           ~7      !1, $6
         11      > JMPNZ                                                    ~7, ->5
   14    12    > > GENERATOR_RETURN                                         

End of function test

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 2
Branch analysis from position: 6
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 2
Branch analysis from position: 6
Branch analysis from position: 2
filename:       /in/c18Dq
function name:  foo
number of ops:  7
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   GENERATOR_CREATE                                         
   17     1      > JMP                                                      ->3
   18     2    >   ECHO                                                     !0
   17     3    >   YIELD                                            $1      
          4        ASSIGN                                           ~2      !0, $1
          5      > JMPNZ                                                    ~2, ->2
   19     6    > > GENERATOR_RETURN                                         

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.43 ms | 1403 KiB | 16 Q