3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __call($method, $args) { echo "A->$method\n"; } public static function __callStatic($method, $args) { echo "A::$method\n"; } } class B extends A { public function test1() { A::test1(); // A->test1 because A is related to B and test1 is non-static } public static function test2() { A::test2(); // A::test2 because A is related to B and test2 is static } } class C { public function test3() { A::test3(); // A::test3 because A is not related to C } public static function test4() { A::test4(); // A::test4 because A is not related to C } } $b = new B(); $b->test1(); $b::test2(); $c = new C(); $c->test3(); $c::test4();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/niCjP
function name:  (null)
number of ops:  17
compiled vars:  !0 = $b, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $2      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   31     3        INIT_METHOD_CALL                                         !0, 'test1'
          4        DO_FCALL                                      0          
   32     5        FETCH_CLASS                                   0  $6      !0
          6        INIT_STATIC_METHOD_CALL                                  $6, 'test2'
          7        DO_FCALL                                      0          
   34     8        NEW                                              $8      'C'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $8
   35    11        INIT_METHOD_CALL                                         !1, 'test3'
         12        DO_FCALL                                      0          
   36    13        FETCH_CLASS                                   0  $12     !1
         14        INIT_STATIC_METHOD_CALL                                  $12, 'test4'
         15        DO_FCALL                                      0          
         16      > RETURN                                                   1

Class A:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/niCjP
function name:  __call
number of ops:  7
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        ROPE_INIT                                     3  ~3      'A-%3E'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_END                                      2  ~2      ~3, '%0A'
          5        ECHO                                                     ~2
    6     6      > 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/niCjP
function name:  __callStatic
number of ops:  7
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        ROPE_INIT                                     3  ~3      'A%3A%3A'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_END                                      2  ~2      ~3, '%0A'
          5        ECHO                                                     ~2
    9     6      > RETURN                                                   null

End of function __callstatic

End of class A.

Class B:
Function test1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/niCjP
function name:  test1
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'test1'
          1        DO_FCALL                                      0          
   15     2      > RETURN                                                   null

End of function test1

Function test2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/niCjP
function name:  test2
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'test2'
          1        DO_FCALL                                      0          
   18     2      > RETURN                                                   null

End of function test2

Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/niCjP
function name:  __call
number of ops:  7
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        ROPE_INIT                                     3  ~3      'A-%3E'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_END                                      2  ~2      ~3, '%0A'
          5        ECHO                                                     ~2
    6     6      > 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/niCjP
function name:  __callStatic
number of ops:  7
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        ROPE_INIT                                     3  ~3      'A%3A%3A'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_END                                      2  ~2      ~3, '%0A'
          5        ECHO                                                     ~2
    9     6      > RETURN                                                   null

End of function __callstatic

End of class B.

Class C:
Function test3:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/niCjP
function name:  test3
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'test3'
          1        DO_FCALL                                      0          
   24     2      > RETURN                                                   null

End of function test3

Function test4:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/niCjP
function name:  test4
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'test4'
          1        DO_FCALL                                      0          
   27     2      > RETURN                                                   null

End of function test4

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.9 ms | 1006 KiB | 13 Q