Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82669 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73418 invoked from network); 14 Feb 2015 05:03:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2015 05:03:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=reeze.xia@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=reeze.xia@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.52 as permitted sender) X-PHP-List-Original-Sender: reeze.xia@gmail.com X-Host-Fingerprint: 74.125.82.52 mail-wg0-f52.google.com Received: from [74.125.82.52] ([74.125.82.52:33674] helo=mail-wg0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 37/3A-15073-E37DED45 for ; Sat, 14 Feb 2015 00:03:58 -0500 Received: by mail-wg0-f52.google.com with SMTP id x12so10427002wgg.11 for ; Fri, 13 Feb 2015 21:03:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=VwW70ZNOTlZtoZvdhBsDsUiPgP7ZdAdfhWZWdAgBqDk=; b=VCn7pzy+zMA8rTV286TK50FKM5RMVjQVFGo3dU5EI99+Ad4QwPdNaxEXmr3ArewrZQ Dc/sPtCwXrxWjNr0x3uY/nQWlOvhPsFRUsgOsRyk74cmc9VvIVX8gsWRrLiPBV98aT8f 38VlcyZZtG4edrGEBdFj4pOaLNWMD9u4qFMYC7iA29yZ7fU8Sq0ByfBHV6bkFfxqW8SN ktfAQMxaANLlrD6xRh7sP6IX40mpNW6K8+8ktB4ltUv73dovqdVnGsXJQgHm8AZRhE2Y rDJbkT++9T8An7eYUJEOLAUbeotOr/Zs4PK0kZV1BBMzNt0sRItUy/4WUcakl0V5hN5+ NpLQ== X-Received: by 10.181.13.174 with SMTP id ez14mr13869883wid.72.1423890234742; Fri, 13 Feb 2015 21:03:54 -0800 (PST) MIME-Version: 1.0 Sender: reeze.xia@gmail.com Received: by 10.194.193.5 with HTTP; Fri, 13 Feb 2015 21:03:34 -0800 (PST) In-Reply-To: <012c01d04812$bf8e7560$3eab6020$@php.net> References: <680FB44D-B42D-4898-A28B-FA1C6E4D4D1A@ajf.me> <012c01d04812$bf8e7560$3eab6020$@php.net> Date: Sat, 14 Feb 2015 13:03:34 +0800 X-Google-Sender-Auth: FG4qmNwm2Xr06BxkRt0wIrn63xQ Message-ID: To: francois@php.net Cc: Andrea Faulds , PHP Internals Content-Type: multipart/alternative; boundary=f46d0435c07ea41d6a050f0547e1 Subject: Re: [PHP-DEV] [RFC] Void Return Type From: reeze@php.net (reeze) --f46d0435c07ea41d6a050f0547e1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable HI, On 14 February 2015 at 12:57, Fran=E7ois Laupretre 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. I= t > 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 ha= s > 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=E7ois > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 Reeze Xia http://reeze.cn --f46d0435c07ea41d6a050f0547e1--