3v4l.org

run code in 500+ PHP versions simultaneously
<?php enum E: string { case A = 'abc'; const B = 'def'; } $name = 'E::A'; echo constant($name)->value; $name = 'E::B'; echo constant($name);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lQY9A
function name:  (null)
number of ops:  13
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'e'
    8     1        ASSIGN                                                       !0, 'E%3A%3AA'
    9     2        INIT_FCALL                                                   'constant'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $2      
          5        FETCH_OBJ_R                                          ~3      $2, 'value'
          6        ECHO                                                         ~3
   10     7        ASSIGN                                                       !0, 'E%3A%3AB'
   11     8        INIT_FCALL                                                   'constant'
          9        SEND_VAR                                                     !0
         10        DO_ICALL                                             $5      
         11        ECHO                                                         $5
         12      > RETURN                                                       1

Class E: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
147.74 ms | 1504 KiB | 14 Q