3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { const CONST_VALUE = 'A constant value'; } $classname = 'MyClass'; echo $classname::CONST_VALUE; // As of PHP 5.3.0 echo MyClass::CONST_VALUE; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1a4pN
function name:  (null)
number of ops:  6
compiled vars:  !0 = $classname
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'MyClass'
    9     1        FETCH_CLASS                                   0  $2      !0
          2        FETCH_CLASS_CONSTANT                             ~3      $2, 'CONST_VALUE'
          3        ECHO                                                     ~3
   11     4        ECHO                                                     'A+constant+value'
   13     5      > RETURN                                                   1

Class MyClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
269.73 ms | 1392 KiB | 14 Q