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() { echo "From B:\n"; forward_static_call(array('A', 'test')); call_user_func(array('A', 'test')); } } class C { public function test() { echo "From C:\n"; forward_static_call(array('A', 'test')); call_user_func(array('A', 'test')); } } A::test(); $b = new B(); $b->test(); $c = new C(); $c->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KOOtY
function name:  (null)
number of ops:  13
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        NEW                                              $3      'B'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
   39     5        INIT_METHOD_CALL                                         !0, 'test'
          6        DO_FCALL                                      0          
   41     7        NEW                                              $7      'C'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $7
   42    10        INIT_METHOD_CALL                                         !1, 'test'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class A:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KOOtY
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/KOOtY
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/KOOtY
function name:  test
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ECHO                                                     'From+B%3A%0A'
   21     1        INIT_FCALL                                               'forward_static_call'
          2        SEND_VAL                                                 <array>
          3        DO_ICALL                                                 
   22     4        INIT_USER_CALL                                0          'call_user_func', <array>
          5        DO_FCALL                                      0          
   23     6      > 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/KOOtY
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/KOOtY
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/KOOtY
function name:  test
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   ECHO                                                     'From+C%3A%0A'
   31     1        INIT_FCALL                                               'forward_static_call'
          2        SEND_VAL                                                 <array>
          3        DO_ICALL                                                 
   32     4        INIT_USER_CALL                                0          'call_user_func', <array>
          5        DO_FCALL                                      0          
   33     6      > RETURN                                                   null

End of function test

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.87 ms | 1400 KiB | 15 Q