Hey:
On Sat, Feb 14, 2015 at 11:18 AM, Andrea Faulds <[email protected]> wrote:
> Hi everyone,
>
> I’ve written a small RFC and patch to add a “void” return type:
>
> https://wiki.php.net/rfc/void_return_type
>
> Please have a read over it. I think this would be a simple, yet useful addition.
be honest, I think it's only part of the idea is implemented.
which make it useless.
in PHP, even if you don't return anything, NULL is returned implicitly.
even if a function is declared return nothing(void).
like:
function a() : void {};
following codes still works:
$b = a();
so, if you want a void return type, and if you want it to be a useful feature..
above expr should be invalid with an error " a() return nothing"
so, I am -1 on this in complete RFC
thanks
>
> Thanks!
> --
> Andrea Faulds
> http://ajf.me/
>
>
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
Xinchen Hui
@Laruence
http://www.laruence.com/