Skip to content

New PHP 8.4 Syntax: Asymmetric visibility #98

@KorvinSzanto

Description

@KorvinSzanto

https://wiki.php.net/rfc/asymmetric-visibility-v2

class Foo
{
    PRIVATE(set) string $bar1 = '';
    public private(SET) string $bar2 = '';
    private(set) public string $bar3 = '';

    public function __construct(
        public protected(SET) string $bar4 = ''
    ) {}
}

See this working here: https://3v4l.org/JDXuq/rfc#vgit.master_jit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions