3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function hi() { echo __CLASS__,' -> A'; } public static function test() { // self::hi(); // 调用当前A类 A::hi(); 输出 A -> A // static::hi(); // 调用子B类 B::hi()覆盖了A::hi(); 输出 B -> B static::child(); // 调用子B类 B::child() // self::child(); // Fatal error: Call to undefined method A::child() } } class B extends A { public static function hi() { echo __CLASS__,' -> B'; } public static function child() { echo 'child'; } } B::test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OmiBt
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_STATIC_METHOD_CALL                                  'B', 'test'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Class A:
Function hi:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OmiBt
function name:  hi
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'A'
          1        ECHO                                                     '+-%3E+A'
    6     2      > RETURN                                                   null

End of function hi

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

End of function test

End of class A.

Class B:
Function hi:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OmiBt
function name:  hi
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ECHO                                                     'B'
          1        ECHO                                                     '+-%3E+B'
   18     2      > RETURN                                                   null

End of function hi

Function child:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OmiBt
function name:  child
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ECHO                                                     'child'
   21     1      > RETURN                                                   null

End of function child

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

End of function test

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.01 ms | 1395 KiB | 13 Q