3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Entity {} class FooEntity extends Entity {} abstract class Repository { abstract public function getDetail(): Entity; } class FooRepository extends Repository { public function getDetail(): FooEntity { return new FooEntity; } } $obj = new FooRepository(); $obj->getDetail();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/innXW
function name:  (null)
number of ops:  6
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'FooRepository'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_METHOD_CALL                                         !0, 'getDetail'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class Entity: [no user functions]
Class FooEntity: [no user functions]
Class Repository:
Function getdetail:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/innXW
function name:  getDetail
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   VERIFY_RETURN_TYPE                                       
          1      > RETURN                                                   null

End of function getdetail

End of class Repository.

Class FooRepository:
Function getdetail:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/innXW
function name:  getDetail
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $0      'FooEntity'
          1        DO_FCALL                                      0          
          2        VERIFY_RETURN_TYPE                                       $0
          3      > RETURN                                                   $0
   16     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function getdetail

End of class FooRepository.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.06 ms | 1393 KiB | 13 Q