3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function init ( $resources = null ) { if ( ! $resources ) $resources = get_class_methods(__CLASS__); foreach ( $resources as $method ) { if ( ! ( substr($method, 0, 5) == '_init' ) ) $method = '_init' . $method; if ( ! method_exists(__CLASS__, $method)) continue; self::$method(); } } protected static function _initCharset () { var_dump('Charset'); } protected static function _initConfig () { var_dump('Config'); } protected static function _initDoctrine () { var_dump('Doctrine'); } protected static function _initCookie () { var_dump('Cookie'); } protected static function _initA () { var_dump('A'); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BpWVW
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E > > RETURN                                                   1

Class A:
Function init:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 29
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 29
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 26
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 19
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 7
filename:       /in/BpWVW
function name:  init
number of ops:  31
compiled vars:  !0 = $resources, !1 = $method
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      null
    5     1        BOOL_NOT                                         ~2      !0
          2      > JMPZ                                                     ~2, ->7
    6     3    >   INIT_FCALL                                               'get_class_methods'
          4        SEND_VAL                                                 'A'
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !0, $3
    8     7    > > FE_RESET_R                                       $5      !0, ->29
          8    > > FE_FETCH_R                                               $5, !1, ->29
    9     9    >   INIT_FCALL                                               'substr'
         10        SEND_VAR                                                 !1
         11        SEND_VAL                                                 0
         12        SEND_VAL                                                 5
         13        DO_ICALL                                         $6      
         14        IS_EQUAL                                         ~7      $6, '_init'
         15        BOOL_NOT                                         ~8      ~7
         16      > JMPZ                                                     ~8, ->19
   10    17    >   CONCAT                                           ~9      '_init', !1
         18        ASSIGN                                                   !1, ~9
   12    19    >   INIT_FCALL                                               'method_exists'
         20        SEND_VAL                                                 'A'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $11     
         23        BOOL_NOT                                         ~12     $11
         24      > JMPZ                                                     ~12, ->26
   13    25    > > JMP                                                      ->8
   15    26    >   INIT_STATIC_METHOD_CALL                                  !1
         27        DO_FCALL                                      0          
    8    28      > JMP                                                      ->8
         29    >   FE_FREE                                                  $5
   17    30      > RETURN                                                   null

End of function init

Function _initcharset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BpWVW
function name:  _initCharset
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'Charset'
          2        DO_ICALL                                                 
   21     3      > RETURN                                                   null

End of function _initcharset

Function _initconfig:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BpWVW
function name:  _initConfig
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'Config'
          2        DO_ICALL                                                 
   25     3      > RETURN                                                   null

End of function _initconfig

Function _initdoctrine:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BpWVW
function name:  _initDoctrine
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'Doctrine'
          2        DO_ICALL                                                 
   29     3      > RETURN                                                   null

End of function _initdoctrine

Function _initcookie:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BpWVW
function name:  _initCookie
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'Cookie'
          2        DO_ICALL                                                 
   33     3      > RETURN                                                   null

End of function _initcookie

Function _inita:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BpWVW
function name:  _initA
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'A'
          2        DO_ICALL                                                 
   37     3      > RETURN                                                   null

End of function _inita

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.92 ms | 1405 KiB | 21 Q