Re: [PHP-DEV] Order of properties in (array) cast on PHP 8.1

2021-10-13 Thread Benjamin Morel
> > Yes, this change is expected and documented, see: > > https://www.php.net/manual/en/migration81.other-changes.php#migration81.other-changes.functions.core > Thanks for the pointer! And sorry for the noise. — Benjamin

Re: [PHP-DEV] Order of properties in (array) cast on PHP 8.1

2021-10-13 Thread G. P. B.
On Wed, 13 Oct 2021 at 22:45, Benjamin Morel wrote: > Hi internals, > > While running the test suite of one of my libs against PHP 8.1, I noticed > that the order in which properties are returned in an (array) cast has > changed. > > For example when casting an instance of this class to array: >

[PHP-DEV] Order of properties in (array) cast on PHP 8.1

2021-10-13 Thread Benjamin Morel
Hi internals, While running the test suite of one of my libs against PHP 8.1, I noticed that the order in which properties are returned in an (array) cast has changed. For example when casting an instance of this class to array: class A { private $x = 'x'; } class B extends A { public

Re: [PHP-DEV] Re: [RFC] Deprecate dynamic properties

2021-10-13 Thread Pierre
Le 13/10/2021 à 14:42, Rowan Tommins a écrit : 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

Re: [PHP-DEV] Re: [RFC] Deprecate dynamic properties

2021-10-13 Thread Rowan Tommins
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,

Re: [PHP-DEV] Re: [RFC] Deprecate dynamic properties

2021-10-13 Thread Pierre
Le 13/10/2021 à 11:17, Guilliam Xavier a écrit : 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.) And why not ?

Re: [PHP-DEV] Re: [RFC] Deprecate dynamic properties

2021-10-13 Thread Guilliam Xavier
On Wed, Oct 13, 2021 at 11:17 AM 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). >

Re: [PHP-DEV] Re: [RFC] Deprecate dynamic properties

2021-10-13 Thread Guilliam Xavier
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.)

Re: [PHP-DEV] Re: [RFC] Deprecate dynamic properties

2021-10-13 Thread Rowan Tommins
On 13/10/2021 02:43, Tim Starling wrote: I think it would still be the biggest compatibility break since PHP 4->5. I think this is a rather large exaggeration. It's certainly a use case we need to consider, but it's not on the scale of call-time pass-by-reference, or removing the mysql

Re: [PHP-DEV] Re: [RFC] Deprecate dynamic properties

2021-10-13 Thread Nikita Popov
On Wed, Oct 13, 2021 at 3:43 AM Tim Starling wrote: > On 12/10/21 9:23 pm, Nikita Popov wrote: > > Based on the received feedback, I've updated the RFC to instead provide > an > > #[AllowDynamicProperties] attribute as a way to opt-in to the use of > > dynamic properties. As previously