mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00

When resolving constants on a dynamically declared class during preloading, the enum class may not be available. Fail gracefully in that case. Possibly we shouldn't be trying to evaluate constants on non-linked classes at all?
18 lines
188 B
PHP
18 lines
188 B
PHP
<?php
|
|
|
|
enum MyEnum {
|
|
case Foo;
|
|
case Bar;
|
|
}
|
|
var_dump(MyEnum::Bar);
|
|
|
|
class Test {
|
|
public $x = MyEnum::Bar;
|
|
}
|
|
new Test;
|
|
|
|
if (false) {
|
|
enum MyEnum2 {
|
|
case Foo;
|
|
}
|
|
}
|