3v4l.org

run code in 300+ PHP versions simultaneously
<?php defined('PHP_EOL') or define('PHP_EOL', '\n'); class A { public static function test(){ echo '__CLASS__ = ' . __CLASS__ . PHP_EOL; echo 'get_class = ' . get_class() . PHP_EOL; // echo '__CLASS__ = ' . __CLASS__ . PHP_EOL; } } class B extends A { } echo 'A' . PHP_EOL; A::test(); echo 'B' . PHP_EOL; B::test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JHolu
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'A%0A'
   17     1        INIT_STATIC_METHOD_CALL                                  'A', 'test'
          2        DO_FCALL                                      0          
   18     3        ECHO                                                     'B%0A'
   19     4        INIT_STATIC_METHOD_CALL                                  'B', 'test'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

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

End of function test

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/JHolu
function name:  test
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     '__CLASS__+%3D+A%0A'
    7     1        GET_CLASS                                        ~0      
          2        CONCAT                                           ~1      'get_class+%3D+', ~0
          3        CONCAT                                           ~2      ~1, '%0A'
          4        ECHO                                                     ~2
    9     5      > RETURN                                                   null

End of function test

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.27 ms | 1394 KiB | 13 Q