3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Testing { public function scopeList() { echo "scopeList"; } public function __call($method, $parameters) { if($method == "list") { $this->scopeList(); } } public static function __callStatic($method, $parameters) { echo 1; die(); $instance = new static; call_user_func_array([$instance, $method], $parameters); } } Testing::list(); // fails Testing::{'list'}(); // works $testing = new Testing(); $testing->list(); //works
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SvdvO
function name:  (null)
number of ops:  10
compiled vars:  !0 = $testing
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_STATIC_METHOD_CALL                                  'Testing', 'list'
          1        DO_FCALL                                      0          
   23     2        INIT_STATIC_METHOD_CALL                                  'Testing', 'list'
          3        DO_FCALL                                      0          
   25     4        NEW                                              $3      'Testing'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
   26     7        INIT_METHOD_CALL                                         !0, 'list'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

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

End of function scopelist

Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/SvdvO
function name:  __call
number of ops:  7
compiled vars:  !0 = $method, !1 = $parameters
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        IS_EQUAL                                                 !0, 'list'
          3      > JMPZ                                                     ~2, ->6
   11     4    >   INIT_METHOD_CALL                                         'scopeList'
          5        DO_FCALL                                      0          
   13     6    > > RETURN                                                   null

End of function __call

Function __callstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/SvdvO
function name:  __callStatic
number of ops:  14
compiled vars:  !0 = $method, !1 = $parameters, !2 = $instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        ECHO                                                     1
          3      > EXIT                                                     
   17     4*       NEW                          static              $3      
          5*       DO_FCALL                                      0          
          6*       ASSIGN                                                   !2, $3
   18     7*       INIT_ARRAY                                       ~6      !2
          8*       ADD_ARRAY_ELEMENT                                ~6      !0
          9*       INIT_USER_CALL                                0          'call_user_func_array', ~6
         10*       SEND_ARRAY                                               !1
         11*       CHECK_UNDEF_ARGS                                         
         12*       DO_FCALL                                      0          
   19    13*     > RETURN                                                   null

End of function __callstatic

End of class Testing.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.54 ms | 1399 KiB | 13 Q