3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum Status { const BORING_CONSTANT = 'test'; const ENUM_VALUE = Status::PUBLISHED; case DRAFT; case PUBLISHED; case ARCHIVED; } $reflection = new ReflectionEnum('Status'); foreach ($reflection->getReflectionConstants() as $const) { if ($const->isEnumCase()) { var_dump($const); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 15
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/A3e7r
function name:  (null)
number of ops:  18
compiled vars:  !0 = $reflection, !1 = $const
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'status'
   13     1        NEW                                              $2      'ReflectionEnum'
          2        SEND_VAL_EX                                              'Status'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   14     5        INIT_METHOD_CALL                                         !0, 'getReflectionConstants'
          6        DO_FCALL                                      0  $5      
          7      > FE_RESET_R                                       $6      $5, ->16
          8    > > FE_FETCH_R                                               $6, !1, ->16
   15     9    >   INIT_METHOD_CALL                                         !1, 'isEnumCase'
         10        DO_FCALL                                      0  $7      
         11      > JMPZ                                                     $7, ->15
   16    12    >   INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
   14    15    > > JMP                                                      ->8
         16    >   FE_FREE                                                  $6
   18    17      > RETURN                                                   1

Class Status: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.19 ms | 1004 KiB | 14 Q