3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Employee {} class SteelFactoryEmployee implements Employee {} class CarsFactoryEmployee implements Employee {} interface Factory { public function hire(Employee $employee): bool; } class SteelFactory implements Factory { public function hire(SteelFactoryEmployee $employee): bool { return true; } } class CarsFactory implements Factory { public function hire(CarsFactoryEmployee $employee): bool { return true; } } class EmploymentDepartment { public function hireNewEmployee(Factory $factory, Employee $employee): void { $factory->hire($employee); } } $someNewEmployee = new SteelFactoryEmployee(); $someFactory = new SteelFactory(); $employmentDepartment = new EmploymentDepartment(); $employmentDepartment->hireNewEmployee($someFactory, $someNewEmployee);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pT2Cb
function name:  (null)
number of ops:  18
compiled vars:  !0 = $someNewEmployee, !1 = $someFactory, !2 = $employmentDepartment
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                            'steelfactoryemployee'
    6     1        DECLARE_CLASS                                            'carsfactoryemployee'
   13     2        DECLARE_CLASS                                            'steelfactory'
   21     3        DECLARE_CLASS                                            'carsfactory'
   37     4        NEW                                              $3      'SteelFactoryEmployee'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
   38     7        NEW                                              $6      'SteelFactory'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $6
   40    10        NEW                                              $9      'EmploymentDepartment'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $9
   41    13        INIT_METHOD_CALL                                         !2, 'hireNewEmployee'
         14        SEND_VAR_EX                                              !1
         15        SEND_VAR_EX                                              !0
         16        DO_FCALL                                      0          
         17      > RETURN                                                   1

Class Employee: [no user functions]
Class SteelFactoryEmployee: [no user functions]
Class CarsFactoryEmployee: [no user functions]
Class Factory:
Function hire:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pT2Cb
function name:  hire
number of ops:  3
compiled vars:  !0 = $employee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        VERIFY_RETURN_TYPE                                       
          2      > RETURN                                                   null

End of function hire

End of class Factory.

Class SteelFactory:
Function hire:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pT2Cb
function name:  hire
number of ops:  4
compiled vars:  !0 = $employee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1      > RETURN                                                   <true>
   18     2*       VERIFY_RETURN_TYPE                                       
          3*     > RETURN                                                   null

End of function hire

End of class SteelFactory.

Class CarsFactory:
Function hire:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pT2Cb
function name:  hire
number of ops:  4
compiled vars:  !0 = $employee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   25     1      > RETURN                                                   <true>
   26     2*       VERIFY_RETURN_TYPE                                       
          3*     > RETURN                                                   null

End of function hire

End of class CarsFactory.

Class EmploymentDepartment:
Function hirenewemployee:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pT2Cb
function name:  hireNewEmployee
number of ops:  6
compiled vars:  !0 = $factory, !1 = $employee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   33     2        INIT_METHOD_CALL                                         !0, 'hire'
          3        SEND_VAR_EX                                              !1
          4        DO_FCALL                                      0          
   34     5      > RETURN                                                   null

End of function hirenewemployee

End of class EmploymentDepartment.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.1 ms | 1390 KiB | 13 Q