Skip to content

Final abstract properties should error #17916

Closed
@ondrejmirtes

Description

@ondrejmirtes

Description

The following code:

<?php

abstract class User
{
	final abstract public string $bar {
		get;
	}
}

Resulted in this output:

no output

But I expected this output instead:

Fatal error: Cannot use the final modifier on an abstract property

Proof: https://3v4l.org/2fSaq

PHP Version

PHP 8.4

Operating System

Irrelevant

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions