3v4l.org

run code in 300+ 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', 'function')); call_user_func(array('A', 'function')); } } class C { public function test() { forward_static_call(array('A', 'function')); call_user_func(array('A', 'function')); } } 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/99jeV
function name:  (null)
number of ops:  15
compiled vars:  !0 = $b, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'test'
          1        DO_FCALL                                      0          
   36     2        ECHO                                                     '+%3D+B+%3D%0A'
   37     3        NEW                                              $3      'B'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $3
   38     6        INIT_METHOD_CALL                                         !0, 'test'
          7        DO_FCALL                                      0          
   40     8        ECHO                                                     '+%3D+C+%3D%0A'
   41     9        NEW                                              $7      'C'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $7
   42    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/99jeV
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/99jeV
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/99jeV
function name:  test
number of ops:  6
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      > 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/99jeV
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/99jeV
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/99jeV
function name:  test
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   INIT_FCALL                                               'forward_static_call'
          1        SEND_VAL                                                 <array>
          2        DO_ICALL                                                 
   30     3        INIT_USER_CALL                                0          'call_user_func', <array>
          4        DO_FCALL                                      0          
   31     5      > RETURN                                                   null

End of function test

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.53 ms | 1400 KiB | 15 Q