3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Repository { public function setAccessLevel(); } interface ContactRepository extends Repository {} abstract class ElasticSearchRepository implements Repository { public function setAccessLevel() : ElasticSearchRepository { return $this; } } abstract class DatabaseRepository implements Repository { public function setAccessLevel() : DatabaseRepository { return $this; } } class ContactESRepository extends ElasticSearchRepository implements ContactRepository { public function setAccessLevel() : ContactRepository { return new class extends ContactESRepository {}; } } $cesr = new ContactESRepository(); $cesr->setAccessLevel();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QufgA
function name:  (null)
number of ops:  10
compiled vars:  !0 = $cesr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_CLASS                                            'contactrepository'
    8     1        DECLARE_CLASS                                            'elasticsearchrepository'
   14     2        DECLARE_CLASS                                            'databaserepository'
   20     3        DECLARE_CLASS                                            'contactesrepository', 'elasticsearchrepository'
   26     4        NEW                                              $1      'ContactESRepository'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $1
   27     7        INIT_METHOD_CALL                                         !0, 'setAccessLevel'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

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

End of function setaccesslevel

End of class Repository.

Class ContactRepository: [no user functions]
Class ElasticSearchRepository:
Function setaccesslevel:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QufgA
function name:  setAccessLevel
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_THIS                                       ~0      
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   11     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function setaccesslevel

End of class ElasticSearchRepository.

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

End of function setaccesslevel

End of class DatabaseRepository.

Class ContactESRepository@anonymous: [no user functions]
Class ContactESRepository:
Function setaccesslevel:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QufgA
function name:  setAccessLevel
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   DECLARE_ANON_CLASS                               <unknown> 'contactesrepository'
          1        NEW                                              $1      $0
          2        DO_FCALL                                      0          
          3        VERIFY_RETURN_TYPE                                       $1
          4      > RETURN                                                   $1
   23     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function setaccesslevel

End of class ContactESRepository.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.58 ms | 1004 KiB | 13 Q