3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { static function foo() { echo " self refers to " . self::class . "\n" . " static refers to " . static::class . "\n"; } } class B extends A {} echo "Calling A::foo():\n"; A::foo(); echo "Calling B::foo():\n"; B::foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nvsiR
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                     'Calling+A%3A%3Afoo%28%29%3A%0A'
   12     1        INIT_STATIC_METHOD_CALL                                  'A', 'foo'
          2        DO_FCALL                                      0          
   13     3        ECHO                                                     'Calling+B%3A%3Afoo%28%29%3A%0A'
   14     4        INIT_STATIC_METHOD_CALL                                  'B', 'foo'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

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

End of function foo

End of class A.

Class B:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nvsiR
function name:  foo
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_CLASS_NAME                                 ~0      
          1        CONCAT                                           ~1      '++self+refers+to+A%0A++static+refers+to+', ~0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
    7     4      > RETURN                                                   null

End of function foo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.91 ms | 1398 KiB | 13 Q