3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public function __call($name, $args) { echo "Not static\n"; } 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/e0mmC
function name:  (null)
number of ops:  15
compiled vars:  !0 = $b, !1 = $c
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   36     0  E >   INIT_STATIC_METHOD_CALL                                      'A', 'test'
          1        DO_FCALL                                          0          
   38     2        ECHO                                                         '+%3D+B+%3D%0A'
   39     3        NEW                                                  $3      'B'
          4        DO_FCALL                                          0          
          5        ASSIGN                                                       !0, $3
   40     6        INIT_METHOD_CALL                                             !0, 'test'
          7        DO_FCALL                                          0          
   42     8        ECHO                                                         '+%3D+C+%3D%0A'
   43     9        NEW                                                  $7      'C'
         10        DO_FCALL                                          0          
         11        ASSIGN                                                       !1, $7
   44    12        INIT_METHOD_CALL                                             !1, 'test'
         13        DO_FCALL                                          0          
         14      > RETURN                                                       1

Class A:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e0mmC
function name:  __call
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                                                         'Not+static%0A'
    8     3      > RETURN                                                       null

End of function __call

Function __callstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e0mmC
function name:  __callStatic
number of ops:  4
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   12     2        ECHO                                                         'Static%0A'
   13     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/e0mmC
function name:  test
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                                   'forward_static_call'
          1        SEND_VAL                                                     <array>
          2        DO_ICALL                                                     
   21     3        INIT_USER_CALL                                    0          'call_user_func', <array>
          4        DO_FCALL                                          0          
   22     5        INIT_STATIC_METHOD_CALL                                      'A', 'stuff'
          6        DO_FCALL                                          0          
   23     7      > RETURN                                                       null

End of function test

Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e0mmC
function name:  __call
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                                                         'Not+static%0A'
    8     3      > RETURN                                                       null

End of function __call

Function __callstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e0mmC
function name:  __callStatic
number of ops:  4
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   12     2        ECHO                                                         'Static%0A'
   13     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/e0mmC
function name:  test
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   30     0  E >   INIT_FCALL                                                   'forward_static_call'
          1        SEND_VAL                                                     <array>
          2        DO_ICALL                                                     
   31     3        INIT_USER_CALL                                    0          'call_user_func', <array>
          4        DO_FCALL                                          0          
   32     5        INIT_STATIC_METHOD_CALL                                      'A', 'stuff'
          6        DO_FCALL                                          0          
   33     7      > RETURN                                                       null

End of function test

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.68 ms | 3307 KiB | 14 Q