3v4l.org

run code in 500+ PHP versions simultaneously
<?php enum e: string { case A = 1; case B = 2; case C = 3; } print_r(e::cases()); print_r(array_column(e::cases(), 'value')); /** Array ( [0] => 1 [1] => 2 [2] => 3 ) */ print_r(array_column(e::cases(), 'name')); /** Array ( [0] => A [1] => B [2] => C ) */ ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JATi0
function name:  (null)
number of ops:  25
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'e'
    9     1        INIT_FCALL                                                   'print_r'
          2        INIT_STATIC_METHOD_CALL                                      'e', 'cases'
          3        DO_FCALL                                          0  $0      
          4        SEND_VAR                                                     $0
          5        DO_ICALL                                                     
   10     6        INIT_FCALL                                                   'print_r'
          7        INIT_FCALL                                                   'array_column'
          8        INIT_STATIC_METHOD_CALL                                      'e', 'cases'
          9        DO_FCALL                                          0  $2      
         10        SEND_VAR                                                     $2
         11        SEND_VAL                                                     'value'
         12        DO_ICALL                                             $3      
         13        SEND_VAR                                                     $3
         14        DO_ICALL                                                     
   19    15        INIT_FCALL                                                   'print_r'
         16        INIT_FCALL                                                   'array_column'
         17        INIT_STATIC_METHOD_CALL                                      'e', 'cases'
         18        DO_FCALL                                          0  $5      
         19        SEND_VAR                                                     $5
         20        SEND_VAL                                                     'name'
         21        DO_ICALL                                             $6      
         22        SEND_VAR                                                     $6
         23        DO_ICALL                                                     
   28    24      > RETURN                                                       1

Class e: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.13 ms | 3400 KiB | 15 Q