3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Month extends SplEnum { const __default = self::January; const January = 1; const February = 2; } echo new Month(Month::February) . PHP_EOL; try { new Month(13); } catch (UnexpectedValueException $uve) { echo $uve->getMessage() . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 12
Branch analysis from position: 12
2 jumps found. (Code = 107) Position 1 = 13, Position 2 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gkV9D
function name:  (null)
number of ops:  18
compiled vars:  !0 = $uve
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'month', 'splenum'
    9     1        NEW                                              $1      'Month'
          2        FETCH_CLASS_CONSTANT                             ~2      'Month', 'February'
          3        SEND_VAL_EX                                              ~2
          4        DO_FCALL                                      0          
          5        CONCAT                                           ~4      $1, '%0A'
          6        ECHO                                                     ~4
   12     7        NEW                                              $5      'Month'
          8        SEND_VAL_EX                                              13
          9        DO_FCALL                                      0          
         10        FREE                                                     $5
         11      > JMP                                                      ->17
   13    12  E > > CATCH                                       last         'UnexpectedValueException'
   14    13    >   INIT_METHOD_CALL                                         !0, 'getMessage'
         14        DO_FCALL                                      0  $7      
         15        CONCAT                                           ~8      $7, '%0A'
         16        ECHO                                                     ~8
   15    17    > > RETURN                                                   1

Class Month: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.51 ms | 1393 KiB | 13 Q