summaryrefslogtreecommitdiff
path: root/Zend/tests/enum/no-new-through-reflection.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/enum/no-new-through-reflection.phpt')
-rw-r--r--Zend/tests/enum/no-new-through-reflection.phpt16
1 files changed, 16 insertions, 0 deletions
diff --git a/Zend/tests/enum/no-new-through-reflection.phpt b/Zend/tests/enum/no-new-through-reflection.phpt
new file mode 100644
index 0000000000..9a92559cd3
--- /dev/null
+++ b/Zend/tests/enum/no-new-through-reflection.phpt
@@ -0,0 +1,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