3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ParentClass {} class Child extends ParentClass { public function foo(): ParentClass { return new parent(); } } var_dump((new Child())->foo());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5WDl4
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $0      'Child'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'foo'
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Class ParentClass: [no user functions]
Class Child:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5WDl4
function name:  foo
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                          parent              $0      
          1        DO_FCALL                                      0          
          2        VERIFY_RETURN_TYPE                                       $0
          3      > RETURN                                                   $0
   11     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function foo

End of class Child.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.78 ms | 1001 KiB | 14 Q