3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { function Test(): self {return $this;} } class B extends A { function Test(): B {return $this;} function More():void {} } (new B)->Test()->More();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/flvW8
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   NEW                                                  $0      'B'
          1        DO_FCALL                                          0          
          2        INIT_METHOD_CALL                                             $0, 'Test'
          3        DO_FCALL                                          0  $2      
          4        INIT_METHOD_CALL                                             $2, 'More'
          5        DO_FCALL                                          0          
          6      > RETURN                                                       1

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

End of function test

End of class A.

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

End of function test

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

End of function more

End of class B.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
182.44 ms | 2105 KiB | 13 Q