3v4l.org

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

Class MyClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.58 ms | 1393 KiB | 13 Q