3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { /** @return static */ public function fluent() : self { return $this; } } class MyExtended extends MyClass { public function getClass() : string { return __CLASS__; } } var_dump((new MyExtended())->fluent()->getClass());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VdoHE
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $0      'MyExtended'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'fluent'
          4        DO_FCALL                                      0  $2      
          5        INIT_METHOD_CALL                                         $2, 'getClass'
          6        DO_FCALL                                      0  $3      
          7        SEND_VAR                                                 $3
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

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

End of function fluent

End of class MyClass.

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

End of function getclass

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

End of function fluent

End of class MyExtended.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.34 ms | 1401 KiB | 15 Q