3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface FooInterface { public function test(): FooInterface; } class Foo implements FooInterface { public function test(): Foo { echo 'test'; return $this; } } (new Foo())->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t4ZZ3
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                            'foo'
   17     1        NEW                                              $0      'Foo'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'test'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class FooInterface:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t4ZZ3
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   VERIFY_RETURN_TYPE                                       
          1      > RETURN                                                   null

End of function test

End of class FooInterface.

Class Foo:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t4ZZ3
function name:  test
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     'test'
   13     1        FETCH_THIS                                       ~0      
          2        VERIFY_RETURN_TYPE                                       ~0
          3      > RETURN                                                   ~0
   14     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function test

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.1 ms | 1393 KiB | 13 Q