Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67885 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54560 invoked from network); 26 Jun 2013 15:46:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2013 15:46:10 -0000 Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.176 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.223.176 mail-ie0-f176.google.com Received: from [209.85.223.176] ([209.85.223.176:47856] helo=mail-ie0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4B/45-29746-EBC0BC15 for ; Wed, 26 Jun 2013 11:46:06 -0400 Received: by mail-ie0-f176.google.com with SMTP id ar20so31666787iec.35 for ; Wed, 26 Jun 2013 08:46:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=tSajpSJPkpnjCt+Q7fkTY6CGrwMDY6ZWkV+VUL/Cyek=; b=T3wMw0ymo/vknVb+Z/mVCiyRY8cn31iVmG2Is62bt/kLRGHWCacV1pdKkI0YFIaIYE AqzAKCflURfS5bl4/oNnPxGdl4w9N1zpxOIVoHI2GYLB4KgvcYoOQojINnrbl7fjzLB9 bhJ+nQ2f2O9qdFxZcglBNAud4GANHnSByDBZa9I9wzVrBkf/jMRI2dbyXYSOCl2nr2pQ hSwLYKboE/zVkl/Av+F8jvQmrSjM0Txdmb8h5pAwUuU4/8btILLvbMFVUTemFHMwlqJG 6C4FiZ8MetNTMV18JV7/SW50mX9VMr5jf0QolRqjXySRVZ35Krb0pkMzN/m2QkmwnDrD tJdg== MIME-Version: 1.0 X-Received: by 10.50.32.70 with SMTP id g6mr12385747igi.2.1372261563876; Wed, 26 Jun 2013 08:46:03 -0700 (PDT) Received: by 10.50.65.8 with HTTP; Wed, 26 Jun 2013 08:46:03 -0700 (PDT) In-Reply-To: <1372258135.2410.22.camel@guybrush> References: <1372258135.2410.22.camel@guybrush> Date: Wed, 26 Jun 2013 17:46:03 +0200 Message-ID: To: =?UTF-8?Q?Johannes_Schl=C3=BCter?= Cc: Patrick ALLAERT , Julien Pauli , Maxwell , Sherif Ramadan , Florin Patan , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7b10ca550dd7b604e0108bc9 Subject: Re: [PHP-DEV] Request for comments - new PHP feature: return typing From: tyra3l@gmail.com (Ferenc Kovacs) --047d7b10ca550dd7b604e0108bc9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Jun 26, 2013 at 4:48 PM, Johannes Schl=C3=BCter wrote: > 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 typ= e > > hinting(for scalars), because that affects the caller, while return typ= e > > 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 > > or not trusting the subsystem that he/she calls, and he/she wants to make a hard promise about the return value. I could also mention, that this feature could be used in static analysis and IDEs(albeit most IDEs out there already supports docblocks). I'm not saying that this feature is a must, I just wanted to emphasize that it is a little bit less touchy subject than the (scalar) input typehints. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --047d7b10ca550dd7b604e0108bc9--