Re: Nullsafe

From: Date: Wed, 04 Nov 2020 19:38:47 +0000
Subject: Re: Nullsafe
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-112183@lists.php.net to get a copy of this message
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 <cschneid@cschneid.com> wrote: > Am 04.11.2020 um 19:39 schrieb Eugene Sidelnyk <zsidelnik@gmail.com>: > > 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 reason? > > If you really want you could put an RFC together but I'm pretty sure that > it wouldn't be accepted. > > And now for your dangerous example: > try { > $foo = null; > $foo->bar(); > deletel_all_files_on_machine(); > } catch (Error $dummy) {} > > > Regards, > - Chris > >

« previous php.internals (#112183) next »