3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Log { public function alert($message); } class EchoLog implements Log { public function alert($message) { echo $message; } } class TestLog { private $log; const TEST = ['hoi']; public function __construct(Log $log) { $this->log = $log; } public function run() { $this->log->alert($this->TEST[0]); } } $testLog = new TestLog(new EchoLog()); $testLog->run();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CBONk
function name:  (null)
number of ops:  10
compiled vars:  !0 = $testLog
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_CLASS                                            'echolog'
   27     1        NEW                                              $1      'TestLog'
          2        NEW                                              $2      'EchoLog'
          3        DO_FCALL                                      0          
          4        SEND_VAR_NO_REF_EX                                       $2
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $1
   28     7        INIT_METHOD_CALL                                         !0, 'run'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class Log:
Function alert:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CBONk
function name:  alert
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 alert

End of class Log.

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

End of function alert

End of class EchoLog.

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

End of function __construct

Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CBONk
function name:  run
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   FETCH_OBJ_R                                      ~0      'log'
          1        INIT_METHOD_CALL                                         ~0, 'alert'
          2        CHECK_FUNC_ARG                                           
          3        FETCH_OBJ_FUNC_ARG                               $1      'TEST'
          4        FETCH_DIM_FUNC_ARG                               $2      $1, 0
          5        SEND_FUNC_ARG                                            $2
          6        DO_FCALL                                      0          
   24     7      > RETURN                                                   null

End of function run

End of class TestLog.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.3 ms | 1399 KiB | 13 Q