mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
caefc6a507
Instead mark name/value as readonly and the class as NO_DYNAMIC_PROPERTIES. This gives us the desired limitations using native features. In fact, this also fixes a bug where opcache cache slot merging might result in a write to the name/value properties being allowed. The readonly implementation handles this case correctly.
40 lines
637 B
PHP
40 lines
637 B
PHP
--TEST--
|
|
ReflectionEnumUnitCase::getEnum()
|
|
--FILE--
|
|
<?php
|
|
|
|
enum Foo {
|
|
case Bar;
|
|
}
|
|
|
|
echo (new ReflectionEnumUnitCase(Foo::class, 'Bar'))->getEnum();
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Class [ <user> final class Foo implements UnitEnum ] {
|
|
@@ %sReflectionEnumUnitCase_getEnum.php 3-5
|
|
|
|
- Constants [1] {
|
|
Constant [ public Foo Bar ] { Object }
|
|
}
|
|
|
|
- Static properties [0] {
|
|
}
|
|
|
|
- Static methods [1] {
|
|
Method [ <internal, prototype UnitEnum> static public method cases ] {
|
|
|
|
- Parameters [0] {
|
|
}
|
|
- Return [ array ]
|
|
}
|
|
}
|
|
|
|
- Properties [1] {
|
|
Property [ public readonly string $name ]
|
|
}
|
|
|
|
- Methods [0] {
|
|
}
|
|
}
|