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(); print_r($new::CONST_VALUE); print_r($new::$a); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QathT
function name:  (null)
number of ops:  19
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        INIT_FCALL                                               'print_r'
          9        FETCH_CLASS                                   0  $8      !1
         10        FETCH_CLASS_CONSTANT                             ~9      $8, 'CONST_VALUE'
         11        SEND_VAL                                                 ~9
         12        DO_ICALL                                                 
   15    13        INIT_FCALL                                               'print_r'
         14        FETCH_CLASS                                   0  $11     !1
         15        FETCH_STATIC_PROP_R          unknown             ~12     'a'
         16        SEND_VAL                                                 ~12
         17        DO_ICALL                                                 
   16    18      > RETURN                                                   1

Class MyClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.54 ms | 1394 KiB | 15 Q