Re: [RFC] Void Return Type

From: Date: Sat, 14 Feb 2015 05:03:34 +0000
Subject: Re: [RFC] Void Return Type
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-82669@lists.php.net to get a copy of this message
HI, On 14 February 2015 at 12:57, François Laupretre <francois@php.net> wrote: > > De : Andrea Faulds [mailto:ajf@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

« previous php.internals (#82669) next »