News for hackers. Stuff that matters.
Re:What PHP 5.5 might look like by Sander_Marechal on Thursday July 12, 2012 @01:32PM (#4235594)
The proposals look great! But I'm missing one thing: Less fatal errors, or a better way to catch them. Especially for the case of calling a method on a null value. E.g.

    $foo->getBar()->getBaz()
If getBar() return NULL for some reason, you get a fatal error which you cannot catch and handle without reverting to uglu hacks with a shutdown function.

My personal preference would be to have that statement return NULL and raise a warning or notice, alike to using uninitialized variables.

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.
Re:What PHP 5.5 might look like by philjohn on Thursday July 12, 2012 @02:11PM (#4235801)
or at least throw a NPE which you can catch and handle.