xref: /PHP-8.3/Zend/tests/enum/unit-cases.phpt (revision 269c8dac)
1--TEST--
2Unit enums can list cases
3--FILE--
4<?php
5
6enum Suit {
7    case Hearts;
8    case Diamonds;
9    case Clubs;
10    case Spades;
11    /** @deprecated Typo, use Suit::Hearts */
12    const Hearst = self::Hearts;
13}
14
15var_dump(Suit::cases());
16
17?>
18--EXPECT--
19array(4) {
20  [0]=>
21  enum(Suit::Hearts)
22  [1]=>
23  enum(Suit::Diamonds)
24  [2]=>
25  enum(Suit::Clubs)
26  [3]=>
27  enum(Suit::Spades)
28}
29