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; public function __construct(Log $log) { $this->log = $log; } public function run() { $this->log->alert('This is an alert'); } } $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/EFk35
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'
   25     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
   26     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/EFk35
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/EFk35
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/EFk35
function name:  __construct
number of ops:  4
compiled vars:  !0 = $log
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        ASSIGN_OBJ                                               'log'
          2        OP_DATA                                                  !0
   18     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/EFk35
function name:  run
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_OBJ_R                                      ~0      'log'
          1        INIT_METHOD_CALL                                         ~0, 'alert'
          2        SEND_VAL_EX                                              'This+is+an+alert'
          3        DO_FCALL                                      0          
   22     4      > RETURN                                                   null

End of function run

End of class TestLog.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.9 ms | 1395 KiB | 13 Q