Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52072 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38825 invoked from network); 28 Apr 2011 18:54:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Apr 2011 18:54:05 -0000 Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; 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 unknown Received: from [217.114.211.66] ([217.114.211.66:54502] helo=config.schlueters.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/A1-29189-1C7B9BD4 for ; Thu, 28 Apr 2011 14:53:54 -0400 Received: from [192.168.2.230] (ppp-93-104-50-142.dynamic.mnet-online.de [93.104.50.142]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by config.schlueters.de (Postfix) with ESMTPSA id AB0CE7207F; Thu, 28 Apr 2011 20:53:50 +0200 (CEST) To: Ferenc Kovacs Cc: Stas Malyshev , Felipe Pena , internals In-Reply-To: References: <4DB923E6.3020307@sugarcrm.com> <4DB9A7BE.6010307@sugarcrm.com> Content-Type: text/plain; charset="UTF-8" Date: Thu, 28 Apr 2011 20:53:48 +0200 Message-ID: <1304016828.1561.103.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.2 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Return type-hint From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Thu, 2011-04-28 at 20:04 +0200, Ferenc Kovacs wrote: > > Why I need being "saved" from documenting my code properly? Anyway, the > > function code defines the behavior, declaration of return type just ensures > > function would fail in runtime if your code tries to return unexpected data > > - but how is it helpful? The client of this function doesn't even know that > > before actually calling it! > > > why did we added ppp if people can define in the documentation(or in the > method name :/) that which method is public and which isn't with ppp i prevent the client code from doing something the function/class author didn't expect. With this return hint the function auther can force a runtime error when doing something wrong himself. (which he has to check one way or the other using tests etc.) johannes