Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82702 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66346 invoked from network); 14 Feb 2015 21:23:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2015 21:23:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@tutteli.ch; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@tutteli.ch; sender-id=pass Received-SPF: pass (pb1.pair.com: domain tutteli.ch designates 80.74.154.78 as permitted sender) X-PHP-List-Original-Sender: php@tutteli.ch X-Host-Fingerprint: 80.74.154.78 ns73.kreativmedia.ch Linux 2.6 Received: from [80.74.154.78] ([80.74.154.78:36930] helo=hyperion.kreativmedia.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/00-00421-BECBFD45 for ; Sat, 14 Feb 2015 16:23:56 -0500 Received: (qmail 17504 invoked from network); 14 Feb 2015 22:23:51 +0100 Received: from cm56-153-252.liwest.at (HELO RoLaptop) (86.56.153.252) by ns73.kreativmedia.ch with ESMTPSA (AES256-SHA encrypted, authenticated); 14 Feb 2015 22:23:51 +0100 To: "'Andrea Faulds'" , "'PHP Internals'" References: <680FB44D-B42D-4898-A28B-FA1C6E4D4D1A@ajf.me> In-Reply-To: <680FB44D-B42D-4898-A28B-FA1C6E4D4D1A@ajf.me> Date: Sat, 14 Feb 2015 22:23:49 +0100 Message-ID: <006701d0489c$86a12470$93e36d50$@tutteli.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQJarA5HcqMrZRaN+23HbEjTjl9TGZvb3jug Content-Language: de-ch Subject: AW: [PHP-DEV] [RFC] Void Return Type From: php@tutteli.ch ("Robert Stoll") Hi Andrea, > -----Urspr=C3=BCngliche Nachricht----- > Von: Andrea Faulds [mailto:ajf@ajf.me] > Gesendet: Samstag, 14. Februar 2015 04:18 > An: PHP Internals > Betreff: [PHP-DEV] [RFC] Void Return Type >=20 > Hi everyone, >=20 > I=E2=80=99ve written a small RFC and patch to add a = =E2=80=9Cvoid=E2=80=9D return type: >=20 > https://wiki.php.net/rfc/void_return_type >=20 > Please have a read over it. I think this would be a simple, yet useful = addition. >=20 > Thanks! > -- > Andrea Faulds > http://ajf.me/ >=20 >=20 >=20 >=20 >=20 > -- > PHP Internals - PHP Runtime Development Mailing List To unsubscribe, = visit: http://www.php.net/unsub.php I think a void type for PHP would make sense but only if the return = value of such a function cannot be used.=20 Otherwise it is another reason for people to laugh at PHP and = justifiably so, telling that a function does not return anything but = return null is very inconsistent.=20 I suggest to use one of the following behaviours: 1. declaring a function void does not return anything (hence is like = echo to a certain agree) 2. declaring a function void does return a thing of type void (that = would be similar to Unit in scala) 3. instead of void a function can be declared to be of type null -> = almost the same behaviour as your RFC but without the inconsistency Cheers, Robert