3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function doSomething() { die; yield; } } $foo = new Foo(); $foo->doSomething(); //foreach ($foo->doSomething() as $f) {} echo 'im not dead';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fjXoU
function name:  (null)
number of ops:  7
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   13     3        INIT_METHOD_CALL                                         !0, 'doSomething'
          4        DO_FCALL                                      0          
   16     5        ECHO                                                     'im+not+dead'
          6      > RETURN                                                   1

Class Foo:
Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/fjXoU
function name:  doSomething
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   GENERATOR_CREATE                                         
    7     1      > EXIT                                                     
    8     2*       YIELD                                                    
    9     3*     > GENERATOR_RETURN                                         

End of function dosomething

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.79 ms | 1393 KiB | 13 Q