3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface VisitorInterface { } interface SerializeVisitorInterface extends VisitorInterface { public function visitSomething(); } class SerializeVisitor implements SerializeVisitorInterface { public function visitSomething() { echo 'Hi something'; } } class BaseEvent { protected $visitor; public function getVisitor(): VisitorInterface { return $this->visitor; } } class SerializeEvent extends BaseEvent { public function __construct() { $this->visitor = new SerializeVisitor(); } public function getVisitor(): SerializeVisitorInterface { return $this->visitor; } } $event = new SerializeEvent(); $event->getVisitor()->visitSomething();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GgXXV
function name:  (null)
number of ops:  11
compiled vars:  !0 = $event
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'serializevisitorinterface'
   12     1        DECLARE_CLASS                                            'serializevisitor'
   30     2        DECLARE_CLASS                                            'serializeevent', 'baseevent'
   43     3        NEW                                              $1      'SerializeEvent'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   45     6        INIT_METHOD_CALL                                         !0, 'getVisitor'
          7        DO_FCALL                                      0  $4      
          8        INIT_METHOD_CALL                                         $4, 'visitSomething'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Class VisitorInterface: [no user functions]
Class SerializeVisitorInterface:
Function visitsomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GgXXV
function name:  visitSomething
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   null

End of function visitsomething

End of class SerializeVisitorInterface.

Class SerializeVisitor:
Function visitsomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GgXXV
function name:  visitSomething
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'Hi+something'
   17     1      > RETURN                                                   null

End of function visitsomething

End of class SerializeVisitor.

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

End of function getvisitor

End of class BaseEvent.

Class SerializeEvent:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GgXXV
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   NEW                                              $1      'SerializeVisitor'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'visitor'
          3        OP_DATA                                                  $1
   35     4      > RETURN                                                   null

End of function __construct

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

End of function getvisitor

End of class SerializeEvent.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.16 ms | 1428 KiB | 13 Q