Re: [PHP-DEV] [RFC][Discussion] Objects can be declared falsifiable

2020-07-14 Thread Matthew Brown
On Tue, 14 Jul 2020 at 19:59, Josh Bruce wrote: > Implement an interface and magic method to allow objects to represent > false (or empty) while still be valid instances of the custom object (type). > > https://wiki.php.net/rfc/objects-can-be-falsifiable < >

[PHP-DEV] [RFC][Discussion] Objects can be declared falsifiable

2020-07-14 Thread Josh Bruce
Implement an interface and magic method to allow objects to represent false (or empty) while still be valid instances of the custom object (type). https://wiki.php.net/rfc/objects-can-be-falsifiable If you saw the latest from this morning,

Re: [PHP-DEV] [RFC] Saner string to number comparisons

2020-07-14 Thread Björn Larsson
Den 2020-07-14 kl. 15:48, skrev Nikita Popov: On Thu, Jul 2, 2020 at 10:09 AM Nikita Popov wrote: On Mon, Mar 4, 2019 at 6:00 PM Nikita Popov wrote: On Wed, Feb 27, 2019 at 10:23 AM Zeev Suraski wrote: On Tue, Feb 26, 2019 at 2:27 PM Nikita Popov wrote: Hi internals, I think it is

Re: [PHP-DEV] [RFC] Nullsafe operator

2020-07-14 Thread Björn Larsson
Den 2020-07-14 kl. 10:51, skrev Ilija Tovilo: Hi Markus https://wiki.php.net/rfc/nullsafe_operator Would this still work together with short-circuiting and the null coalesce operator? $country = $session?->user?->getAddress()?->country ?? 'defaultCountry'; Yes, your example will still

Re: [PHP-DEV] Changing default assertion mode to throw exceptions

2020-07-14 Thread Marcio Almada
Hi! On Mon, Jul 13, 2020 at 11:52 AM Marcio Almada > wrote: > > > I'd like to change the default mode of assertion failures to throw. > > > The current default is to warn. In my opinion this is a bad strategy: > > > the engine asserted that something that is expected to be true is not, > > > so

Re: [PHP-DEV] [CONCEPT][DISCUSSION] Allow objects to declareemptiness and by extension truthiness

2020-07-14 Thread Josh Bruce
> On Jul 14, 2020, at 1:24 PM, Josh Bruce wrote: > > >> On Jul 13, 2020, at 12:14 PM, Christoph M. Becker wrote: >> >> On 13.07.2020 at 17:18, Josh Bruce wrote: >> >>> Re the wiki: I can edit pages now, it doesn’t look like I can create them. >>> There’s another thread I’ve been watching

Re: [PHP-DEV] [CONCEPT][DISCUSSION] Allow objects to declareemptiness and by extension truthiness

2020-07-14 Thread Josh Bruce
> On Jul 13, 2020, at 12:14 PM, Christoph M. Becker wrote: > > On 13.07.2020 at 17:18, Josh Bruce wrote: > >> Re the wiki: I can edit pages now, it doesn’t look like I can create them. >> There’s another thread I’ve been watching and I think I need more karma to >> make that a thing. I will

Re: [PHP-DEV] Changing default assertion mode to throw exceptions

2020-07-14 Thread Theodore Brown
On Tue, July 14 2020 at 10:10 AM Levi Morrison wrote: > On Mon, Jul 13, 2020 at 11:52 AM Marcio Almada wrote: > > > I'd like to change the default mode of assertion failures to throw. > > > The current default is to warn. In my opinion this is a bad strategy: > > > the engine asserted that

Re: [PHP-DEV][RFC] Saner numeric strings

2020-07-14 Thread G. P. B.
Hello internals, Apologies again for the delay, I was pointed out a sort of inconsistency between arithmetic/bitwise ops and type declarations. I've tried to address this in the RFC by promoting all current warnings to TypeErrors: https://wiki.php.net/rfc/saner-numeric-strings Please have a

Re: [PHP-DEV] [RFC] Treat namespaced names as single token, relax reserved keyword restrictions

2020-07-14 Thread Josh Bruce
New to the discussion and being this deep; so, apologies for any bumps. Mainly questions. Does this only affect the string after the “namespace” keyword (make implicit explicit)? So, things like “use” with a stack of classes within a base namespace would still be possible? On reserved words,

Re: [PHP-DEV] Changing default assertion mode to throw exceptions

2020-07-14 Thread Levi Morrison via internals
On Mon, Jul 13, 2020 at 11:52 AM Marcio Almada wrote: > > I'd like to change the default mode of assertion failures to throw. > > The current default is to warn. In my opinion this is a bad strategy: > > the engine asserted that something that is expected to be true is not, > > so executing

Re: [PHP-DEV] [RFC] Saner string to number comparisons

2020-07-14 Thread Nikita Popov
On Thu, Jul 2, 2020 at 10:09 AM Nikita Popov wrote: > On Mon, Mar 4, 2019 at 6:00 PM Nikita Popov wrote: > >> On Wed, Feb 27, 2019 at 10:23 AM Zeev Suraski wrote: >> >>> >>> >>> On Tue, Feb 26, 2019 at 2:27 PM Nikita Popov >>> wrote: >>> Hi internals, I think it is well known

Re: [PHP-DEV] [RFC] Treat namespaced names as single token, relax reserved keyword restrictions

2020-07-14 Thread Brent Roose
Hi Nikita What happens to the attributes syntax if this RFC doesn't pass? Furthermore, I think voting against this RFC to prevent the @@ syntax from happening is an abuse of the system. If there are problems with the attribute syntax, than the vote results on that one should be called void and

Re: [PHP-DEV] [RFC] Nullsafe operator

2020-07-14 Thread Markus Fischer
Hi, On 14.07.20 10:51, Ilija Tovilo wrote: Would this still work together with short-circuiting and the null coalesce operator? $country = $session?->user?->getAddress()?->country ?? 'defaultCountry'; Yes, your example will still work, this is solely about references :) Thanks for

[PHP-DEV] Re: [RFC] Treat namespaced names as single token, relax reserved keyword restrictions

2020-07-14 Thread Nikita Popov
On Thu, Jul 9, 2020 at 4:33 PM Nikita Popov wrote: > On Tue, Jun 16, 2020 at 10:52 AM Nikita Popov > wrote: > >> Hi internals, >> >> Inspired by the recent discussion on reserved keyword reservation, I'd >> like to propose the following RFC: >> >>

Re: [PHP-DEV] Drop warning about non-public magic methods

2020-07-14 Thread Nikita Popov
On Mon, Jul 13, 2020 at 9:32 PM Mark Randall wrote: > On 13/07/2020 19:32, Gabriel Caruso wrote: > > This warning does not make much sense as the magic method is executed > > regardless of its visibility. Should it be dropped? > This seems to be the bigger issue... if something is specified as >

Re: [PHP-DEV] [RFC] Nullsafe operator

2020-07-14 Thread Ilija Tovilo
Hi Markus > > https://wiki.php.net/rfc/nullsafe_operator > > Would this still work together with short-circuiting and the null > coalesce operator? > > $country = $session?->user?->getAddress()?->country ?? 'defaultCountry'; Yes, your example will still work, this is solely about references :)

Re: [PHP-DEV] [RFC] Nullsafe operator

2020-07-14 Thread Markus Fischer
Hi Ilija, I'd like to introduce another RFC I've been working on: https://wiki.php.net/rfc/nullsafe_operator It introduces the nullsafe operator ?-> that skips null values when calling functions and fetching properties. In contrast to the last few attempts this RFC includes full short

Re: [PHP-DEV] Re: [RFC] Nullsafe operator

2020-07-14 Thread Ilija Tovilo
Hi internals >> https://wiki.php.net/rfc/nullsafe_operator > > I updated the RFC to disallow using the nullsafe operator in > expressions passed by reference. This solves the last remaining > (known) issue. If there are no objections I'd like to start the vote > on Tuesday, 2020-07-14. I have

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-14 Thread Rowan Tommins
On Mon, 13 Jul 2020 at 22:32, Olle Härstedt wrote: > In the end I need uniqueness (non-aliasing) to finish my series of > patches about typestate and type-safe builders to Psalm, but I guess I > can live without any runtime representation of this, or just suffer > the hack I already did with