Re: [PHP-DEV] [RFC] Undefined Property Error Promotion

2022-04-19 Thread Guilliam Xavier
On Sat, Apr 16, 2022 at 12:01 AM David Rodrigues wrote: > > $foo[?'maynotexist'] // returns null and emits no warning > > In JS we have some like: > > foo['maynotexist'] > foo?.['maynotexist'] > > In PHP could be: > > $foo['maynotexist'] > $foo?->['maynotexist'] > You seem to be confusing two di

Re: [PHP-DEV] [RFC] Undefined Property Error Promotion

2022-04-15 Thread David Rodrigues
> $foo[?'maynotexist'] // returns null and emits no warning In JS we have some like: foo['maynotexist'] foo?.['maynotexist'] In PHP could be: $foo['maynotexist'] $foo?->['maynotexist'] Atenciosamente, David Rodrigues Em sex., 15 de abr. de 2022 às 18:41, Mark Randall escreveu: > On 06/04/2

Re: [PHP-DEV] [RFC] Undefined Property Error Promotion

2022-04-15 Thread Mark Randall
On 06/04/2022 19:38, Larry Garfield wrote: On the last point, regarding stdClass, I think the question is whether we want it to be consistent with classed object properties (throw) or with associative arrays (warnings). stdClass is kind of an uncomfortable middle between those two. I'm not s

Re: [PHP-DEV] [RFC] Undefined Property Error Promotion

2022-04-06 Thread Larry Garfield
On Wed, Apr 6, 2022, at 7:03 AM, Mark Randall wrote: > Internals, > > Part 2 of the undefined behaviour improvements, this time focusing on > properties. > > https://wiki.php.net/rfc/undefined_property_error_promotion > > This RFC draws heavily from the just passed undefined variables error > pro

Re: [PHP-DEV] [RFC] Undefined Property Error Promotion

2022-04-06 Thread Mark Randall
On 06/04/2022 17:34, Marco Pivetta wrote: Perhaps worth mentioning that magic methods keep working? Good call. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Undefined Property Error Promotion

2022-04-06 Thread Rowan Tommins
On Wed, 6 Apr 2022 at 14:37, Guilliam Xavier wrote: > First sentence of the introduction: "Undefined properties are those that > have not yet been defined either by the presence of a property declaration, > or by adding them to the properties hashmap through direct assignment, or > by having them

Re: [PHP-DEV] [RFC] Undefined Property Error Promotion

2022-04-06 Thread Marco Pivetta
Hey Mark, On Wed, 6 Apr 2022 at 14:04, Mark Randall wrote: > Internals, > > Part 2 of the undefined behaviour improvements, this time focusing on > properties. > > https://wiki.php.net/rfc/undefined_property_error_promotion > > This RFC draws heavily from the just passed undefined variables err

Re: [PHP-DEV] [RFC] Undefined Property Error Promotion

2022-04-06 Thread Guilliam Xavier
On Wed, Apr 6, 2022 at 2:37 PM Robert Landers wrote: > > FWIW, I'd like to see option 2 only because of custom serializers > and/or object proxies and also because: > > > This RFC proposes that accessing an undefined property is rendered > illegal behaviour > > StdClass has *no* defined propertie

Re: [PHP-DEV] [RFC] Undefined Property Error Promotion

2022-04-06 Thread Guilliam Xavier
Hi Mark, https://wiki.php.net/rfc/undefined_property_error_promotion > [note: the RFC Date has a +1 on the year] I'm in favor for "fixed" classes (with all properties declared and no `__get()` magic method), but somewhat mixed for `stdClass`: as you said, it can come from a `json_decode()` by de

Re: [PHP-DEV] [RFC] Undefined Property Error Promotion

2022-04-06 Thread Robert Landers
On Wed, Apr 6, 2022 at 2:04 PM Mark Randall wrote: > > Internals, > > Part 2 of the undefined behaviour improvements, this time focusing on > properties. > > https://wiki.php.net/rfc/undefined_property_error_promotion > > This RFC draws heavily from the just passed undefined variables error > prom