mirror of
https://github.com/php/php-src.git
synced 2026-04-29 03:03:26 +02:00
269c8dac1d
RFC: https://wiki.php.net/rfc/enumerations Co-authored-by: Nikita Popov <nikita.ppv@gmail.com> Closes GH-6489.
17 lines
248 B
PHP
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
|