-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Description
Description
The following code:
<?php
enum MyEnum {}
class Demo extends MyEnum {}
Resulted in this output:
Fatal error: Class Demo cannot extend final class MyEnum in /in/mbUsQ on line 5
But I expected this output instead:
[some message about not being able to extend enums]
For built-in enums (which https://3v4l.org/XvT2b reports were only added in 8.3 with Random\IntervalBoundary
) the message is even more confusing:
<?php
class Demo extends Random\IntervalBoundary {}
produces
Fatal error: Non-enum class Demo cannot implement interface UnitEnum in /in/8VLv9 on line 3
PHP Version
PHP 8.2+