Re: [RFC] Nullsafe calls

From: Date: Fri, 12 Dec 2014 09:02:15 +0000
Subject: Re: [RFC] Nullsafe calls
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-79587@lists.php.net to get a copy of this message
I agree, doing lots of if statements gets bloated. Someone would only use this method if they was comfortable with it either returning null or the desired result. On 11/12/2014 16:00, Rowan Collins wrote:
guilhermeblanco@gmail.com wrote on 11/12/2014 15:57:
Not trying to demerit the proposal, but accepting ?-> and black magic just seems wrong, very wrong. You need to write defensive code, not rely on the language to do that for you.
But surely if you're consciously deciding to use this feature, it *is* defensive code - just defensive code involving less copy-and-paste of if ( ! is_null($blah) )...


« previous php.internals (#79587) next »