3v4l.org

run code in 300+ 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.0.0


preferences:
142.77 ms | 1000 KiB | 14 Q