3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface CommandInterface {} abstract class AbstractCommand implements CommandInterface {} interface PrefixableCommandInterface {} abstract class PrefixableCommand extends AbstractCommand implements PrefixableCommandInterface { } class StringSet extends PrefixableCommand {} interface ConnectionInterface {} class Connection implements ConnectionInterface { public function executeCommand(CommandInterface $command) { echo 'foo connection'; } } class Tester { private $connection; public function __construct() { $this->connection = new Connection(); } public function executeCommand(CommandInterface $command) { $this->connection->executeCommand($command); } } $t = new Tester(); $t->executeCommand(new StringSet);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BnDg5
function name:  (null)
number of ops:  13
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                            'abstractcommand'
   11     1        DECLARE_CLASS                                            'prefixablecommand', 'abstractcommand'
   14     2        DECLARE_CLASS                                            'stringset', 'prefixablecommand'
   20     3        DECLARE_CLASS                                            'connection'
   38     4        NEW                                              $1      'Tester'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $1
   39     7        INIT_METHOD_CALL                                         !0, 'executeCommand'
          8        NEW                                              $4      'StringSet'
          9        DO_FCALL                                      0          
         10        SEND_VAR_NO_REF_EX                                       $4
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class CommandInterface: [no user functions]
Class AbstractCommand: [no user functions]
Class PrefixableCommandInterface: [no user functions]
Class PrefixableCommand: [no user functions]
Class StringSet: [no user functions]
Class ConnectionInterface: [no user functions]
Class Connection:
Function executecommand:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BnDg5
function name:  executeCommand
number of ops:  3
compiled vars:  !0 = $command
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   23     1        ECHO                                                     'foo+connection'
   24     2      > RETURN                                                   null

End of function executecommand

End of class Connection.

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

End of function __construct

Function executecommand:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BnDg5
function name:  executeCommand
number of ops:  6
compiled vars:  !0 = $command
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   RECV                                             !0      
   34     1        FETCH_OBJ_R                                      ~1      'connection'
          2        INIT_METHOD_CALL                                         ~1, 'executeCommand'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
   35     5      > RETURN                                                   null

End of function executecommand

End of class Tester.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.32 ms | 1399 KiB | 13 Q