3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Logger { public function log(string $msg); } class Application { private $logger; public function getLogger(): Logger { return $this->logger; } public function setLogger(Logger $logger) { $this->logger = $logger; } } $app = new Application; $app->setLogger(new class implements Logger { public function log(string $msg) { echo $msg; } }); $app->getLogger()->log("bla bla"); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3rsvr
function name:  (null)
number of ops:  15
compiled vars:  !0 = $app
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'Application'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        INIT_METHOD_CALL                                         !0, 'setLogger'
          4        DECLARE_ANON_CLASS                               <unknown> 
          5        NEW                                              $5      $4
          6        DO_FCALL                                      0          
          7        SEND_VAR_NO_REF_EX                                       $5
          8        DO_FCALL                                      0          
   25     9        INIT_METHOD_CALL                                         !0, 'getLogger'
         10        DO_FCALL                                      0  $8      
         11        INIT_METHOD_CALL                                         $8, 'log'
         12        SEND_VAL_EX                                              'bla+bla'
         13        DO_FCALL                                      0          
   26    14      > RETURN                                                   1

Class Logger:
Function log:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3rsvr
function name:  log
number of ops:  2
compiled vars:  !0 = $msg
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 Application:
Function getlogger:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3rsvr
function name:  getLogger
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_OBJ_R                                      ~0      'logger'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   11     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getlogger

Function setlogger:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3rsvr
function name:  setLogger
number of ops:  4
compiled vars:  !0 = $logger
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        ASSIGN_OBJ                                               'logger'
          2        OP_DATA                                                  !0
   15     3      > RETURN                                                   null

End of function setlogger

End of class Application.

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

End of function log

End of class Logger@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.65 ms | 1399 KiB | 13 Q