3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Log; interface TestInterface { public function log(); } use Log\TestInterface; class Handler implements TestInterface { public function log() { //some logic goes here } } use Log\Handler; class Log { public function __construct(TestInterface $handler) { $handler->log('test'); } } $obj = new Log(new Handler());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Sifdb
function name:  (null)
number of ops:  8
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   DECLARE_CLASS                                            'log%5Chandler'
   27     1        NEW                                              $1      'Log%5CLog'
          2        NEW                                              $2      'Log%5CHandler'
          3        DO_FCALL                                      0          
          4        SEND_VAR_NO_REF_EX                                       $2
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $1
          7      > RETURN                                                   1

Class Log\TestInterface:
Function log:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Sifdb
function name:  log
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   null

End of function log

End of class Log\TestInterface.

Class Log\Handler:
Function log:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Sifdb
function name:  log
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E > > RETURN                                                   null

End of function log

End of class Log\Handler.

Class Log\Log:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Sifdb
function name:  __construct
number of ops:  5
compiled vars:  !0 = $handler
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   23     1        INIT_METHOD_CALL                                         !0, 'log'
          2        SEND_VAL_EX                                              'test'
          3        DO_FCALL                                      0          
   24     4      > RETURN                                                   null

End of function __construct

End of class Log\Log.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.14 ms | 1394 KiB | 13 Q