xref: /PHP-8.1/Zend/tests/enum/print_r.phpt (revision 269c8dac)
1--TEST--
2Enum print_r
3--FILE--
4<?php
5
6enum Foo {
7    case Bar;
8}
9
10enum IntFoo: int {
11    case Bar = 42;
12}
13
14enum StringFoo: string {
15    case Bar = 'Bar';
16}
17
18print_r(Foo::Bar);
19print_r(IntFoo::Bar);
20print_r(StringFoo::Bar);
21
22?>
23--EXPECT--
24Foo Enum
25(
26    [name] => Bar
27)
28IntFoo Enum:int
29(
30    [name] => Bar
31    [value] => 42
32)
33StringFoo Enum:string
34(
35    [name] => Bar
36    [value] => Bar
37)
38