summaryrefslogtreecommitdiff
path: root/Zend/tests/enum/no-new-through-reflection.phpt
blob: 9a92559cd3d61e26e5f13de4fe8854dace8f92f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--TEST--
Enum no new through reflection
--FILE--
<?php

enum Foo {}

try {
    (new \ReflectionClass(Foo::class))->newInstanceWithoutConstructor();
} catch (Error $e) {
    echo $e->getMessage() . "\n";
}

?>
--EXPECT--
Cannot instantiate enum Foo