3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (($ver = phpversion()) != '5.5.0beta4') die($ver); function test () { while ($data = yield) echo $data.'\n'; } $d = test(); var_dump($d); $d->send('something'); $d->send('something2');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KnS5T
function name:  (null)
number of ops:  19
compiled vars:  !0 = $ver, !1 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'phpversion'
          1        DO_ICALL                                         $2      
          2        ASSIGN                                           ~3      !0, $2
          3        IS_NOT_EQUAL                                             ~3, '5.5.0beta4'
          4      > JMPZ                                                     ~4, ->6
          5    > > EXIT                                                     !0
   10     6    >   INIT_FCALL                                               'test'
          7        DO_FCALL                                      0  $5      
          8        ASSIGN                                                   !1, $5
   11     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
   12    12        INIT_METHOD_CALL                                         !1, 'send'
         13        SEND_VAL_EX                                              'something'
         14        DO_FCALL                                      0          
   13    15        INIT_METHOD_CALL                                         !1, 'send'
         16        SEND_VAL_EX                                              'something2'
         17        DO_FCALL                                      0          
         18      > RETURN                                                   1

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

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.01 ms | 1390 KiB | 18 Q