Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82673 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80342 invoked from network); 14 Feb 2015 05:55:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2015 05:55:04 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.45 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.45 mail-pa0-f45.google.com Received: from [209.85.220.45] ([209.85.220.45:64911] helo=mail-pa0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E4/9B-15073-633EED45 for ; Sat, 14 Feb 2015 00:55:03 -0500 Received: by mail-pa0-f45.google.com with SMTP id rd3so16569876pab.4 for ; Fri, 13 Feb 2015 21:54:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=O2Q3Z+HP7qSwVTOK0vux2jnRZkDEowQk3mUZ9BHDUzs=; b=LmnKkQ9R0+TBl3cAaNazitsqN5YCHJlnzgMjlZ501X23412qjKBrutwsCrAubIcySD 3JV2Up8HmENvzGqdq6dPYzvJcKnpXTYJbnZrcnFOVf8mS8sPmZin/P7+lZMOgBNiUV/S arS9/LdlEWB/tDusjjY5t8sQaRBwj03C5OvU3H8oVglfLf+Ywg+J3WB+iV4/KR42TvNY eSii1oe9Zy0IoFWr0RQ6zyOLvEetu0IFKTwb39sqfzx56NG1nIAuQDr/+/+hryL/KKTa AGoaAA4NfiXOnSn1en0tD8Pu18x/hAOVCoXa7VUrCAXbpaHbLEQCV1MWK5BSwx9UP58C h4VA== X-Received: by 10.68.141.204 with SMTP id rq12mr20879707pbb.7.1423893298986; Fri, 13 Feb 2015 21:54:58 -0800 (PST) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id xf5sm8259208pbb.95.2015.02.13.21.54.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Feb 2015 21:54:58 -0800 (PST) Message-ID: <54DEE32B.6040706@gmail.com> Date: Fri, 13 Feb 2015 21:54:51 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Andrea Faulds , PHP Internals References: <680FB44D-B42D-4898-A28B-FA1C6E4D4D1A@ajf.me> In-Reply-To: <680FB44D-B42D-4898-A28B-FA1C6E4D4D1A@ajf.me> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] Void Return Type From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > 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. I'm not sure what it is useful for, exactly. I mean, the more fatal errors the merrier, but I fail to see what exactly use except having yet more cases when your code may break it provides. I mean, if you defined a void function, that means you're not using it return value anywhere. Then who cares what return statement says? If you _are_ using its return value, then a) why you declared it as void and b) how comes you expect return value from a function that is supposed to always return null? Additionally, this RFC gets inheritance wrong - having return from function that previously did not return anything is not a violation of contract, since there's no practical contract that can rely on function not returning anything (in fact, there's no way in PHP to even check that AFAIK). Summarily, this seems to me an exercise in strictness for the sake of strictness. There are languages that force people to abide by a lot of rules because their creators believe more rules is the same as better code, but PHP never was one of them and the fact there are so many people trying to make PHP that makes me sad. -- Stas Malyshev smalyshev@gmail.com