3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface CustomerRepositoryInterface {} class SQLCustomerRepository implements CustomerRepositoryInterface { public function sayHi() { return 'Hi!'; } } class Controller { protected $repository; public function __contruct(CustomerRepositoryInterface $repository) { $this->repository = $repository; echo $this->repository->sayHi(); } } echo $this->repository->sayHi();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eYgLK
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CLASS                                            'sqlcustomerrepository'
   22     1        FETCH_THIS                                       $0      
          2        FETCH_OBJ_R                                      ~1      $0, 'repository'
          3        INIT_METHOD_CALL                                         ~1, 'sayHi'
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6      > RETURN                                                   1

Class CustomerRepositoryInterface: [no user functions]
Class SQLCustomerRepository:
Function sayhi:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eYgLK
function name:  sayHi
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   'Hi%21'
    9     1*     > RETURN                                                   null

End of function sayhi

End of class SQLCustomerRepository.

Class Controller:
Function __contruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eYgLK
function name:  __contruct
number of ops:  8
compiled vars:  !0 = $repository
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   18     1        ASSIGN_OBJ                                               'repository'
          2        OP_DATA                                                  !0
   19     3        FETCH_OBJ_R                                      ~2      'repository'
          4        INIT_METHOD_CALL                                         ~2, 'sayHi'
          5        DO_FCALL                                      0  $3      
          6        ECHO                                                     $3
   20     7      > RETURN                                                   null

End of function __contruct

End of class Controller.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.14 ms | 1394 KiB | 13 Q