3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Controller { public function index($otherObj) { echo "Calling Controller::index\n"; if (method_exists($this, 'hook_' . __FUNCTION__)) { $this->{'hook_' . __FUNCTION__}(); } if (method_exists($otherObj, 'hook_' . __FUNCTION__)) { $otherObj->{'hook_' . __FUNCTION__}(); } } public function hook_index() { echo "Calling Controller::hook_index\n"; } } class LocalController { public function hook_index() { echo "Calling LocalController::hook_index\n"; } } $localController = new LocalController(); $controller = new Controller(); $controller->index($localController);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FiEJB
function name:  (null)
number of ops:  10
compiled vars:  !0 = $localController, !1 = $controller
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   NEW                                              $2      'LocalController'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   33     3        NEW                                              $5      'Controller'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   34     6        INIT_METHOD_CALL                                         !1, 'index'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class Controller:
Function index:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 10
filename:       /in/FiEJB
function name:  index
number of ops:  18
compiled vars:  !0 = $otherObj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ECHO                                                     'Calling+Controller%3A%3Aindex%0A'
    8     2        INIT_FCALL                                               'method_exists'
          3        FETCH_THIS                                       ~1      
          4        SEND_VAL                                                 ~1
          5        SEND_VAL                                                 'hook_index'
          6        DO_ICALL                                         $2      
          7      > JMPZ                                                     $2, ->10
   10     8    >   INIT_METHOD_CALL                                         'hook_index'
          9        DO_FCALL                                      0          
   13    10    >   INIT_FCALL                                               'method_exists'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 'hook_index'
         13        DO_ICALL                                         $4      
         14      > JMPZ                                                     $4, ->17
   15    15    >   INIT_METHOD_CALL                                         !0, 'hook_index'
         16        DO_FCALL                                      0          
   17    17    > > RETURN                                                   null

End of function index

Function hook_index:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FiEJB
function name:  hook_index
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ECHO                                                     'Calling+Controller%3A%3Ahook_index%0A'
   21     1      > RETURN                                                   null

End of function hook_index

End of class Controller.

Class LocalController:
Function hook_index:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FiEJB
function name:  hook_index
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   ECHO                                                     'Calling+LocalController%3A%3Ahook_index%0A'
   28     1      > RETURN                                                   null

End of function hook_index

End of class LocalController.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145 ms | 1018 KiB | 14 Q