Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56994 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77959 invoked from network); 22 Dec 2011 14:33:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Dec 2011 14:33:46 -0000 Authentication-Results: pb1.pair.com header.from=sebastian.krebs.berlin@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.215.170 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@googlemail.com X-Host-Fingerprint: 209.85.215.170 mail-ey0-f170.google.com Received: from [209.85.215.170] ([209.85.215.170:40155] helo=mail-ey0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 18/23-47744-9CF33FE4 for ; Thu, 22 Dec 2011 09:33:46 -0500 Received: by eaai11 with SMTP id i11so7801055eaa.29 for ; Thu, 22 Dec 2011 06:33:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:sender:x-google-sender-delegation:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=yTDJiENsbUZF5GLNwHaBlYWZttjA1ZjQfV1gYiYADAg=; b=FAhxyBjxUuXDIYzCLRr/J4L2yfcNfTbyM4/3Uc/y8xsUoWua7oiEuLOk4rVulLfSIF DhLc4INr93ZROouI28wytRTJmY/HuBj6faDWRqrdVdmbGCf3ECzqeTFRL0eTTFrLXmGC HEA4ORyOXGvZV4UHWbnlmv9y7cYGluHuR8eQ4= MIME-Version: 1.0 Received: by 10.204.156.210 with SMTP id y18mr3282653bkw.118.1324564420121; Thu, 22 Dec 2011 06:33:40 -0800 (PST) Sender: sebastian.krebs.berlin@googlemail.com X-Google-Sender-Delegation: sebastian.krebs.berlin@googlemail.com Received: by 10.204.69.78 with HTTP; Thu, 22 Dec 2011 06:33:40 -0800 (PST) In-Reply-To: <005701ccc0b3$58c8dee0$0a5a9ca0$@alliantinternet.com> References: <2095305E-D4E3-4D7E-8218-32EE99688E0C@GMAIL.COM> <2C90FB94-38C4-4270-8C6A-B89304BA8ED8@gmail.com> <159A7CA2-8561-40DA-9434-CAAE12304DDB@gmail.com> <005701ccc0b3$58c8dee0$0a5a9ca0$@alliantinternet.com> Date: Thu, 22 Dec 2011 15:33:40 +0100 X-Google-Sender-Auth: GDpnNN4Bw7SrXGEjR91O1cpqtE8 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=0015175ce226be542404b4af2f1b Subject: Re: [PHP-DEV] Return Type Hinting for Methods RFC From: krebs.seb@googlemail.com (Sebastian Krebs) --0015175ce226be542404b4af2f1b Content-Type: text/plain; charset=ISO-8859-1 2011/12/22 Dmitri Snytkine > The return type hinting is probably the biggest thing happening in php in a > long time. > Is this too good to be true? > > With return type hinting I can see a huge improvenets in php IDEs in > spotting errors. Also it will be much easier to auto generate wsdl files > when return types are known to a compiler. > These are just to name a couple of important benefits that can come out of > it. > > What I don't see is any discussion of being able to declare the type of > variable, you now, like in Java. > ie: > private \ArrayObject $customers; > Once more "Why is PHP not Java?" > > Also, is there an implicit "void" return type? > > I hope that declaring types of variables will be added too because without > it, this feature is not all that useful. > > Dmitri Snytkine > Web Developer > Ultra Logistics, Inc. > Phone: (888) 220-4640 x 2097 > Fax: (888) 795-6642 > E-Mail: dsnytkine@ultralogistics.com > Web: www.ultralogistics.com > > "A Top 100 Logistics I.T. Provider in 2011" > > > -----Original Message----- > From: Will Fitch [mailto:will.fitch@gmail.com] > Sent: Wednesday, December 21, 2011 5:29 PM > To: Pierre Joye > Cc: Nikita Popov; PHP Developers Mailing List > Subject: Re: [PHP-DEV] Return Type Hinting for Methods RFC > > Hi Pierre and Nikita, > > I have added callable to the patch and updated the RFC entry to reflect the > changes. Please verify and let me know if you have any issues. > > On Dec 21, 2011, at 2:33 PM, Pierre Joye wrote: > > > hi Will, > > > > You should add it now, while 5.4 final is not released yet, this > > feature exists already and should be part of the RFC, to be complete. > > > > Cheers, > > > > On Wed, Dec 21, 2011 at 6:22 PM, Will Fitch > wrote: > >> Hi Nikita, > >> > >> I didn't add that as it's not yet in production. As soon as things are > finalized and 5.4 is GA, I will gladly add the callable type hint. The > change wouldn't be different from parameter type hinting, and can easily be > added. > >> > >> On Dec 21, 2011, at 12:17 PM, Nikita Popov wrote: > >> > >>> Hi Will! > >>> > >>> One random thought I had while reading the RFC is: What about the > >>> newly introduced callable typehint? Is this missing by intention? I > >>> could well imagine so (because it's hard to check what scope > >>> callability should be checked on), but wanted to be sure on that. > >>> > >>> Nikita > >>> > >>> On Wed, Dec 21, 2011 at 3:09 AM, Will Fitch > wrote: > >>>> Hello All, > >>>> > >>>> I would like to submit https://wiki.php.net/rfc/returntypehint2 into > discussion. A link to the patch for this is provided and can be ran > against > the current HEAD. > >>>> > >>>> There is an older entry still in existence, but this patch is > syntactically different. The older entry is located at > https://wiki.php.net/rfc/typechecking and is bundled with parameter, > scalars, etc. > >>>> > >>>> If possible, can someone promote this to the "Under Discussion" > category within https://wiki.php.net/rfc? > >>>> > >>>> -- Will > >>>> -- > >>>> PHP Internals - PHP Runtime Development Mailing List > >>>> To unsubscribe, visit: http://www.php.net/unsub.php > >>>> > >> > >> > >> -- > >> PHP Internals - PHP Runtime Development Mailing List > >> To unsubscribe, visit: http://www.php.net/unsub.php > >> > > > > > > > > -- > > Pierre > > > > @pierrejoye | http://blog.thepimp.net | http://www.libgd.org > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --0015175ce226be542404b4af2f1b--