Re: [PHP-DEV] [RFC] Short-function syntax

2020-11-04 Thread Nuno Maduro
Hey Larry, In my vision, this proposal is a good addition to PHP exactly as stated in this pull request (https://github.com/php/php-src/pull/6221): where only the "=> expr;" is introduced, and not the "fn". For visual consistency in the future of PHP functions/methods, I think it's important to d

Re: [PHP-DEV] Nullsafe

2020-11-04 Thread Josh Bruce
> On Nov 4, 2020, at 1:38 PM, Eugene Sidelnyk wrote: > > Yeah... Creating null was a huge mistake. > Now it is probably too late to fix that (maybe some new language can > introduce that). > > But what do you think about introducing special class `NullObject`? I would rather let an instance be

Re: [PHP-DEV] Nullsafe

2020-11-04 Thread Marco Pivetta
Hey, On Wed, Nov 4, 2020, 20:39 Eugene Sidelnyk wrote: > Yeah... Creating null was a huge mistake. > Now it is probably too late to fix that (maybe some new language can > introduce that). > > Y'all confusing Java's `null` (billion dollar mistake) with PHP's `null`. * In Java, `null|object` pa

Re: [PHP-DEV] Nullsafe

2020-11-04 Thread Eugene Sidelnyk
Yeah... Creating null was a huge mistake. Now it is probably too late to fix that (maybe some new language can introduce that). But what do you think about introducing special class `NullObject`? On Wed, Nov 4, 2020, 9:32 PM Christian Schneider wrote: > Am 04.11.2020 um 19:39 schrieb Eugene Sid

Re: [PHP-DEV] Nullsafe

2020-11-04 Thread Christian Schneider
Am 04.11.2020 um 19:39 schrieb Eugene Sidelnyk : > Thus, can you provide any other dangerous example? I think at this point you could have realised that it is a) a BC break (code which has thrown an exception before now wouldn't) b) not finding any love among the community here. Possibly for a rea

Re: [PHP-DEV] Nullsafe

2020-11-04 Thread Josh Bruce
> Implicit nullable is terrible, moreover I don't see why users should return > null values more often. > They serve their purpose but most of the time you can use another sane/safe > default of the given > property type. > Agreed. I’m not overly opinionated about much, but null as a default

Re: [PHP-DEV] Nullsafe

2020-11-04 Thread Eugene Sidelnyk
Thus, can you provide any other dangerous example? On Wed, Nov 4, 2020, 6:59 AM Eugene Sidelnyk wrote: > But wait! > > In your example, funds won't get detracted. If `$accounts->get($receiver)` > will return `null`, then everything inside `addFunds(...)` will not be > executed. > Your example (s