Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67877 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40101 invoked from network); 26 Jun 2013 14:49:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2013 14:49:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.211.66 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.211.66 config.schlueters.de Received: from [217.114.211.66] ([217.114.211.66:52153] helo=config.schlueters.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D0/32-29746-B5FFAC15 for ; Wed, 26 Jun 2013 10:49:00 -0400 Received: from [192.168.2.20] (ppp-88-217-78-161.dynamic.mnet-online.de [88.217.78.161]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by config.schlueters.de (Postfix) with ESMTPSA id 87B3B651AC; Wed, 26 Jun 2013 16:48:56 +0200 (CEST) To: Ferenc Kovacs Cc: Patrick ALLAERT , Julien Pauli , Maxwell , Sherif Ramadan , Florin Patan , "internals@lists.php.net" In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Wed, 26 Jun 2013 16:48:55 +0200 Message-ID: <1372258135.2410.22.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Request for comments - new PHP feature: return typing From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Wed, 2013-06-26 at 16:40 +0200, Ferenc Kovacs wrote: > > > I think that the return typehints a bit easier topic than the input type > hinting(for scalars), because that affects the caller, while return type > hinting is more contained: you write the function, you put the return > typehint there, if the method tries to return something else, then your > code is at fault. > So even if we would allow return typehints for scalars that would only > affects those functions where the developer opts-in. So a function author doesn't trust himself and therefore we change the language syntax? johannes