3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class EventManager { public static function call($sEvent) { $aClasses = ['B']; foreach ($aClasses as $sClassName) { $oMethodChecking = new ReflectionMethod($sClassName,$sFunctionName); $sFunctionName = 'event_'.$sEvent; if (method_exists($sClassName, $sFunctionName) && $oMethodChecking->isStatic()) { call_user_func($sClassName.'::'.$sFunctionName); } } } } final class B { public static function event_event_name() { echo 'ok'; } } EventManager::call('event_name');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UpOX8
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_STATIC_METHOD_CALL                                  'EventManager', 'call'
          1        SEND_VAL                                                 'event_name'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Class EventManager:
Function call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 25
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 25
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 24
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 24
Branch analysis from position: 19
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/UpOX8
function name:  call
number of ops:  27
compiled vars:  !0 = $sEvent, !1 = $aClasses, !2 = $sClassName, !3 = $oMethodChecking, !4 = $sFunctionName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN                                                   !1, <array>
    8     2      > FE_RESET_R                                       $6      !1, ->25
          3    > > FE_FETCH_R                                               $6, !2, ->25
    9     4    >   NEW                                              $7      'ReflectionMethod'
          5        SEND_VAR_EX                                              !2
          6        SEND_VAR_EX                                              !4
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !3, $7
   10     9        CONCAT                                           ~10     'event_', !0
         10        ASSIGN                                                   !4, ~10
   11    11        INIT_FCALL                                               'method_exists'
         12        SEND_VAR                                                 !2
         13        SEND_VAR                                                 !4
         14        DO_ICALL                                         $12     
         15      > JMPZ_EX                                          ~13     $12, ->19
         16    >   INIT_METHOD_CALL                                         !3, 'isStatic'
         17        DO_FCALL                                      0  $14     
         18        BOOL                                             ~13     $14
         19    > > JMPZ                                                     ~13, ->24
   12    20    >   CONCAT                                           ~15     !2, '%3A%3A'
         21        CONCAT                                           ~16     ~15, !4
         22        INIT_USER_CALL                                0          'call_user_func', ~16
         23        DO_FCALL                                      0          
    8    24    > > JMP                                                      ->3
         25    >   FE_FREE                                                  $6
   15    26      > RETURN                                                   null

End of function call

End of class EventManager.

Class B:
Function event_event_name:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UpOX8
function name:  event_event_name
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ECHO                                                     'ok'
   22     1      > RETURN                                                   null

End of function event_event_name

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.34 ms | 1392 KiB | 15 Q