3v4l.org

run code in 500+ PHP versions simultaneously
<?php enum Suit: string { case Clubs = '♣'; case Diamonds = '♦'; case Hearts = '♥'; case Spades = '♠'; } $cardString = 'Clubs'; $cardEnumFQString = Suit::class . '::' . $cardString; $cardEnum = constant($cardEnumFQString); echo $cardEnum->value;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WTrIv
function name:  (null)
number of ops:  11
compiled vars:  !0 = $cardString, !1 = $cardEnumFQString, !2 = $cardEnum
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'suit'
   10     1        ASSIGN                                                       !0, 'Clubs'
   11     2        CONCAT                                               ~4      'Suit%3A%3A', !0
          3        ASSIGN                                                       !1, ~4
   12     4        INIT_FCALL                                                   'constant'
          5        SEND_VAR                                                     !1
          6        DO_ICALL                                             $6      
          7        ASSIGN                                                       !2, $6
   14     8        FETCH_OBJ_R                                          ~8      !2, 'value'
          9        ECHO                                                         ~8
   15    10      > RETURN                                                       1

Class Suit: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.23 ms | 1341 KiB | 14 Q