Skip to content

Enums should not be allowed to implement interfaces with properties in 8.4 #16447

Open
@vudaltsov

Description

@vudaltsov

Description

The following code:

interface I
{
    public string $x { get; }
}

enum E implements I
{
}

Resulted in this output:

PHP Fatal error:  Enum E must implement 1 abstract private method (I::$x::get)

But I expected this output instead:

PHP Fatal error:  Enum E cannot implement interfaces with properties

PHP Version

PHP 8.4.0-dev (cli) (built: Sep 24 2024 14:38:59) (NTS)

Operating System

MacOS

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions