Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37079 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76998 invoked from network); 17 Apr 2008 16:04:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2008 16:04:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=sam@sambarrow.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sam@sambarrow.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sambarrow.com from 208.70.128.56 cause and error) X-PHP-List-Original-Sender: sam@sambarrow.com X-Host-Fingerprint: 208.70.128.56 smtp-gw30.mailanyone.net Received: from [208.70.128.56] ([208.70.128.56:55834] helo=smtp-gw30.mailanyone.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B9/5F-05127-2F477084 for ; Thu, 17 Apr 2008 12:04:02 -0400 Received: from mailanyone.net by smtp-gw30.mailanyone.net with esmtpsa (TLSv1:RC4-MD5:128) (MailAnyone extSMTP sam@sambarrow.com) id 1JmWad-0006vK-Rm; Thu, 17 Apr 2008 11:04:00 -0500 To: Chris Stockton Cc: internals@lists.php.net In-Reply-To: References: <46ccd1ab0804170742g142ed562t4f03339da549a820@mail.gmail.com> <48076FB3.1040303@cschneid.com> Content-Type: text/plain Date: Thu, 17 Apr 2008 12:01:36 -0400 Message-ID: <1208448096.32403.13.camel@sbarrow-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [RFC] Strict type hints (parameter and return value) From: sam@sambarrow.com (Sam Barrow) On Thu, 2008-04-17 at 08:54 -0700, Chris Stockton wrote: > I like this patch, it adds a feature which a lot of companies and code base > would surely implement without breaking anything. The only thing I do not > like has already been mentioned, numeric and scalar are not included. > > The one thing I don't dislike, but am unsure of the ease to understand by > users is the return type hinting syntax, using type casting. Maybe I am > wrong but do you think users might get confused by it since it already has > an existing purpose of transforming values to other types, maybe they will > think at glance it transforms the return type to something else? Of course > it would be fault of there own for not reading, but is it NATURAL to use the > existing type hints for it? > > Why not: > function int foo($foo) { } > > I understand the problem with adding the INT as a keyword, and how that > maybe: > function int int($foo) { } I like this alot better too, the only downside is compatibility problems. > is awkward, but would be rare and seems to be more correct. I know it would > be more difficult to implement the latter but it should not be impossible > should it? > > Just throwing it out there, it is a nice patch and a nice feature for A LOT > of people even though it is not exactly the php way, but all things must > evolve. > > -Chris