News for hackers. Stuff that matters.
Re:Upcoming changes in PHP 7.1 by spdionis on Monday May 23, 2016 @08:57AM (#11753531)
Even if you have a point it wouldn't matter because making void functions return something else than null would be a big (useless) BC break.

There's a lot of code that uses "return;" to mean "return null;" and honestly I don't see it as a big problem.

Re:Upcoming changes in PHP 7.1 by arenaninja on Monday May 23, 2016 @10:30AM (#11754051)
The point I was trying to make is that PHP does not have -- nor should it have, I think -- a concept of void. Functions without a return statement already return null. "return;" is already equivalent to "return null;" as well, as you pointed out. It would be more consistent to type-hint return null instead of introducing a new return type (void) into the language. I know PHPDoc already uses "@return void", and I have never liked it for the same reason. It is not a concept used anywhere else in PHP, AFAIK.
Re:Upcoming changes in PHP 7.1 by wtetzner on Monday May 23, 2016 @12:35PM (#11754925)
I think having a void return type makes a lot of sense, because it says "this function will never return anything but null".