3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Core { protected static $_instance = null; public static function __callStatic($method, $args) { if (static::$_instance === null) { static::$_instance = new static; } return static::$_instance->$method($args); //return call_user_func_array(array(static::$_instance, $method), $args); } } class ConstructCore extends Core { public function getModulesManager() { return 'manager'; } } var_dump(ConstructCore::getModulesManager());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Tlhpi
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'ConstructCore', 'getModulesManager'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
          5      > RETURN                                                   1

Class Core:
Function __callstatic:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/Tlhpi
function name:  __callStatic
number of ops:  15
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        FETCH_STATIC_PROP_R          unknown             ~2      '_instance'
          3        TYPE_CHECK                                    2          ~2
          4      > JMPZ                                                     ~3, ->9
   10     5    >   NEW                          static              $5      
          6        DO_FCALL                                      0          
          7        ASSIGN_STATIC_PROP                                       '_instance'
          8        OP_DATA                                                  $5
   13     9    >   FETCH_STATIC_PROP_R          unknown             ~7      '_instance'
         10        INIT_METHOD_CALL                                         ~7, !0
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0  $8      
         13      > RETURN                                                   $8
   16    14*     > RETURN                                                   null

End of function __callstatic

End of class Core.

Class ConstructCore:
Function getmodulesmanager:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Tlhpi
function name:  getModulesManager
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E > > RETURN                                                   'manager'
   24     1*     > RETURN                                                   null

End of function getmodulesmanager

Function __callstatic:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/Tlhpi
function name:  __callStatic
number of ops:  15
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        FETCH_STATIC_PROP_R          unknown             ~2      '_instance'
          3        TYPE_CHECK                                    2          ~2
          4      > JMPZ                                                     ~3, ->9
   10     5    >   NEW                          static              $5      
          6        DO_FCALL                                      0          
          7        ASSIGN_STATIC_PROP                                       '_instance'
          8        OP_DATA                                                  $5
   13     9    >   FETCH_STATIC_PROP_R          unknown             ~7      '_instance'
         10        INIT_METHOD_CALL                                         ~7, !0
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0  $8      
         13      > RETURN                                                   $8
   16    14*     > RETURN                                                   null

End of function __callstatic

End of class ConstructCore.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.93 ms | 1404 KiB | 15 Q