Re: Initial discussion - more deprecation options

From: Date: Wed, 07 May 2025 20:02:33 +0000
Subject: Re: Initial discussion - more deprecation options
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi

Am 2025-05-07 21:43, schrieb Niels Dossche:
Definitely NAK on deprecating properties, which has the potential of adding lots of overhead.
FWIW: Deprecating properties is already possibly by means of deprecating a property hook. I guess this is an acceptable workaround to not require a dedicated support + associated complexity. see: https://3v4l.org/C6jRQ
    class Foo
    {
        public string $foo
        {
            #[\Deprecated]
            get {
                return $this->foo;
            }
            #[\Deprecated]
            set {
                $this->foo = $value;
            }
        }
    }
    $f = new Foo();
    $f->foo = 'dummy';
    var_dump($f->foo);
Best regards Tim Düsterhus

Thread (7 messages)

« previous php.internals (#127311) next »