3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Logger { public function log($message); } class TerminalLogger implements Logger { public function log($message) { var_dump($message); } } class Application { protected $logger; public function setLogger($logger) { $this->logger = $logger; return $this; } public function action() { $this->logger->log(); } } $app = new Application(); $app->setLogger(new TerminalLogger); $app->action();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6uq9p
function name:  (null)
number of ops:  12
compiled vars:  !0 = $app
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_CLASS                                            'terminallogger'
   26     1        NEW                                              $1      'Application'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   27     4        INIT_METHOD_CALL                                         !0, 'setLogger'
          5        NEW                                              $4      'TerminalLogger'
          6        DO_FCALL                                      0          
          7        SEND_VAR_NO_REF_EX                                       $4
          8        DO_FCALL                                      0          
   28     9        INIT_METHOD_CALL                                         !0, 'action'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

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

End of function log

End of class Logger.

Class TerminalLogger:
Function log:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6uq9p
function name:  log
number of ops:  5
compiled vars:  !0 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    9     4      > RETURN                                                   null

End of function log

End of class TerminalLogger.

Class Application:
Function setlogger:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6uq9p
function name:  setLogger
number of ops:  6
compiled vars:  !0 = $logger
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        ASSIGN_OBJ                                               'logger'
          2        OP_DATA                                                  !0
   18     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
   19     5*     > RETURN                                                   null

End of function setlogger

Function action:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6uq9p
function name:  action
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   FETCH_OBJ_R                                      ~0      'logger'
          1        INIT_METHOD_CALL                                         ~0, 'log'
          2        DO_FCALL                                      0          
   23     3      > RETURN                                                   null

End of function action

End of class Application.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.22 ms | 1392 KiB | 15 Q