Re: Re: [RFC] Deprecate dynamic properties

From: Date: Wed, 13 Oct 2021 12:42:40 +0000
Subject: Re: Re: [RFC] Deprecate dynamic properties
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-116272@lists.php.net to get a copy of this message
On 13/10/2021 10:17, Guilliam Xavier wrote:
Off-topic:
    if ( class_exists('\\WeakMap') ) {
People should stop using a leading slash in FQCN *strings*.  \Foo::class is "Foo", not "\Foo".  It might work generally but that's asking for problems (e.g. for autoloaders). (Sorry.)
Hah, good point. I should probably just have just used ::class anyway (in which case the leading backslash is the quickest way of the sample code being pasteable into some other file): if ( class_exists(\WeakMap::class) ) { There's probably a bunch of other style no-noes in that example, but I did at least test it worked. :) Regards, -- Rowan Tommins [IMSoP]

« previous php.internals (#116272) next »