3v4l.org

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

Class E: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.97 ms | 1155 KiB | 15 Q