3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Creator { public function create(): void; } class EchoCreator implements Creator { public function create(): void { echo 'Hello world!'; } } trait CreatorAble { abstract protected function creator(): Creator; public function useCreator(): void { $this->creator()->create(); } } final class SomeClass { private $creator; use CreatorAble; public function __construct(Creator $creator) { $this->creator = $creator; } private function creator(): Creator { return $this->creator; } } (new SomeClass(new EchoCreator))->useCreator();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/deDEh
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_CLASS                                            'echocreator'
   28     1        DECLARE_CLASS                                            'someclass'
   46     2        NEW                                              $0      'SomeClass'
          3        NEW                                              $1      'EchoCreator'
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $1
          6        DO_FCALL                                      0          
          7        INIT_METHOD_CALL                                         $0, 'useCreator'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

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

End of function create

End of class Creator.

Class EchoCreator:
Function create:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/deDEh
function name:  create
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     'Hello+world%21'
   14     1      > RETURN                                                   null

End of function create

End of class EchoCreator.

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

End of function creator

Function usecreator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/deDEh
function name:  useCreator
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_METHOD_CALL                                         'creator'
          1        DO_FCALL                                      0  $0      
          2        INIT_METHOD_CALL                                         $0, 'create'
          3        DO_FCALL                                      0          
   24     4      > RETURN                                                   null

End of function usecreator

End of class CreatorAble.

Class SomeClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/deDEh
function name:  __construct
number of ops:  4
compiled vars:  !0 = $creator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
   36     1        ASSIGN_OBJ                                               'creator'
          2        OP_DATA                                                  !0
   37     3      > RETURN                                                   null

End of function __construct

Function creator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/deDEh
function name:  creator
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   FETCH_OBJ_R                                      ~0      'creator'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   42     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function creator

End of class SomeClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.6 ms | 1399 KiB | 13 Q