php-fig / per-coding-style

PER coding style
259 stars 26 forks source link

New PHP 8.4 Syntax: Asymmetric visibility #98

Open KorvinSzanto opened 2 weeks ago

KorvinSzanto commented 2 weeks ago

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

KorvinSzanto commented 2 weeks ago

I think we just need to specify order and casing, I don't think we should disallow including the "public".