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', 'test')); call_user_func(array('A', 'test')); } } class C { public function test() { forward_static_call(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/Pqbk9
function name:  (null)
number of ops:  13
compiled vars:  !0 = $b, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'test'
          1        DO_FCALL                                      0          
   35     2        NEW                                              $3      'B'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
   36     5        INIT_METHOD_CALL                                         !0, 'test'
          6        DO_FCALL                                      0          
   38     7        NEW                                              $7      'C'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $7
   39    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/Pqbk9
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/Pqbk9
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/Pqbk9
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/Pqbk9
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/Pqbk9
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/Pqbk9
function name:  test
number of ops:  4
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      > RETURN                                                   null

End of function test

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.34 ms | 1392 KiB | 15 Q