3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function foo() { self::who(); // PHP binds this to A::who() right away static::who(); // PHP waits to resolve this (hence, late)! } public static function who() { echo __CLASS__."\n"; } } class B extends A { public static function test() { self::foo(); } public static function who() { echo __CLASS__."\n"; } } B::test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OAtAg
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_STATIC_METHOD_CALL                                  'B', 'test'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

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

End of function foo

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

End of function who

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/OAtAg
function name:  test
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_STATIC_METHOD_CALL                                  'foo'
          1        DO_FCALL                                      0          
   16     2      > RETURN                                                   null

End of function test

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

End of function who

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

End of function foo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.34 ms | 1395 KiB | 13 Q