Re:What PHP 5.5 might look like
by smsm42 on Friday July 13, 2012 @01:03AM
(#4238302)
Don't return null from that function. Return NullObject which has __call() { return $this; } - then you could chain as many such calls as you want and they'd be OK with nulls. Then you could check for NullObject as easily as you could check for null - if($result instanceof NullObject) etc.
[ Parent
| on HN ]
There are no comments on this comment yet.