fork download
  1. <?php
  2. class Month extends SplEnum {
  3. const __default = self::January;
  4.  
  5. const January = 1;
  6. const February = 2;
  7. const March = 3;
  8. const April = 4;
  9. const May = 5;
  10. const June = 6;
  11. const July = 7;
  12. const August = 8;
  13. const September = 9;
  14. const October = 10;
  15. const November = 11;
  16. const December = 12;
  17.  
  18.  
  19. }
  20.  
  21. echo new Month(Month::June) . PHP_EOL;
  22.  
  23. // try {
  24. // new Month(13);
  25. // } catch (UnexpectedValueException $uve) {
  26. // echo $uve->getMessage() . PHP_EOL;
  27. // }
  28. ?>
  29.  
Runtime error #stdin #stdout #stderr 0.02s 24400KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Fatal error:  Class 'SplEnum' not found in /home/Klf0Bd/prog.php on line 2