3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public static function __callStatic($name, $args) { echo "Static\n"; } } class B extends A { public function test() { forward_static_call(array('A', 'stuff')); call_user_func(array('A', 'stuff')); A::stuff(); } } class C { public function test() { forward_static_call(array('A', 'stuff')); call_user_func(array('A', 'stuff')); A::stuff(); } } A::test(); echo " = B =\n"; $b = new B(); $b->test(); echo " = C =\n"; $c = new C(); $c->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ummp7
function name:  (null)
number of ops:  15
compiled vars:  !0 = $b, !1 = $c
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   31     0  E >   INIT_STATIC_METHOD_CALL                                      'A', 'test'
          1        DO_FCALL                                          0          
   33     2        ECHO                                                         '+%3D+B+%3D%0A'
   34     3        NEW                                                  $3      'B'
          4        DO_FCALL                                          0          
          5        ASSIGN                                                       !0, $3
   35     6        INIT_METHOD_CALL                                             !0, 'test'
          7        DO_FCALL                                          0          
   37     8        ECHO                                                         '+%3D+C+%3D%0A'
   38     9        NEW                                                  $7      'C'
         10        DO_FCALL                                          0          
         11        ASSIGN                                                       !1, $7
   39    12        INIT_METHOD_CALL                                             !1, 'test'
         13        DO_FCALL                                          0          
         14      > RETURN                                                       1

Class A:
Function __callstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ummp7
function name:  __callStatic
number of ops:  4
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    7     2        ECHO                                                         'Static%0A'
    8     3      > RETURN                                                       null

End of function __callstatic

End of class A.

Class B:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ummp7
function name:  test
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                                   'forward_static_call'
          1        SEND_VAL                                                     <array>
          2        DO_ICALL                                                     
   16     3        INIT_USER_CALL                                    0          'call_user_func', <array>
          4        DO_FCALL                                          0          
   17     5        INIT_STATIC_METHOD_CALL                                      'A', 'stuff'
          6        DO_FCALL                                          0          
   18     7      > RETURN                                                       null

End of function test

Function __callstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ummp7
function name:  __callStatic
number of ops:  4
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    7     2        ECHO                                                         'Static%0A'
    8     3      > RETURN                                                       null

End of function __callstatic

End of class B.

Class C:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ummp7
function name:  test
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                                   'forward_static_call'
          1        SEND_VAL                                                     <array>
          2        DO_ICALL                                                     
   26     3        INIT_USER_CALL                                    0          'call_user_func', <array>
          4        DO_FCALL                                          0          
   27     5        INIT_STATIC_METHOD_CALL                                      'A', 'stuff'
          6        DO_FCALL                                          0          
   28     7      > RETURN                                                       null

End of function test

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.14 ms | 2889 KiB | 14 Q