3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface AggregateRoot {} interface AggregateRootFactory { public function create() : AggregateRoot; } class Customer implements AggregateRoot {} class CustomerFactory implements AggregateRootFactory { public function create() : Customer { return new Customer(); } } $factory = new CustomerFactory(); $customer = $factory->create();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oiLsv
function name:  (null)
number of ops:  9
compiled vars:  !0 = $factory, !1 = $customer
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   DECLARE_CLASS                                            'customer'
   15     1        DECLARE_CLASS                                            'customerfactory'
   23     2        NEW                                              $2      'CustomerFactory'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   24     5        INIT_METHOD_CALL                                         !0, 'create'
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !1, $5
          8      > RETURN                                                   1

Class AggregateRoot: [no user functions]
Class AggregateRootFactory:
Function create:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oiLsv
function name:  create
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 create

End of class AggregateRootFactory.

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

End of function create

End of class CustomerFactory.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.4 ms | 1394 KiB | 13 Q