HI, On 14 February 2015 at 12:57, François Laupretre <franc...@php.net> wrote:
> > De : Andrea Faulds [mailto:a...@ajf.me] > > 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. > > That's a nice addition and a beginning to distinguish void from null, as I > imagine the function still returns null. > > Now, what about making void a real zval type ? It would open a lot of > possibilities. Unlike null, conversions from void would raise an error. It > would also be rejected as argument input type but could be used as an > output type when arg is passed by ref, it could be the default type for return_value (huge BC break > here) and so on... > > There's a need for a real 'no value' type different from null, as null has > too many uses. If defined correctly, it can be a powerful addition. > What is the benefit of passing a void value around just for return type? and the rest of engine will have to take care of IS_VOID type, it seems doesn't worth it. > > François > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Reeze Xia http://reeze.cn