ru_php/Zend/tests/enum/no-new-through-reflection.phpt

17 lines
248 B
PHP

--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