Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67871 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30786 invoked from network); 26 Jun 2013 14:21:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2013 14:21:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=patrick.allaert@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=patrick.allaert@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.45 as permitted sender) X-PHP-List-Original-Sender: patrick.allaert@gmail.com X-Host-Fingerprint: 209.85.219.45 mail-oa0-f45.google.com Received: from [209.85.219.45] ([209.85.219.45:46092] helo=mail-oa0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 95/10-29746-CD8FAC15 for ; Wed, 26 Jun 2013 10:21:16 -0400 Received: by mail-oa0-f45.google.com with SMTP id j1so15084859oag.18 for ; Wed, 26 Jun 2013 07:21:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=B1pt2CADWrsoC7RyN5kH1ELq9vWOYVhwqltK4XnnCvU=; b=gGr7THGuAYUudRp4msOwyB2/ojZKxSZLL29HLYzMKgabPoW1zo9y2LPVPNfVUDZaJL R8cEOx7WD2fMgB68gDb3C8MGNJIhpMJrGWSqC9t7TQDY1du356Me8JhhxDXbuO20iP5n XItnTrlI7ZayG53FrKSuZaWUlMHof8Wd1ZPJjzNcw3QWwDksfsgQHJgHsmmnmb3jceSj 9GWCsMTdXA98FgNSzG7JDpveKtJPm05+TchqKJ9Dja8RkBxL7jfBrDX3COSUoSvNeNjZ xlMM0dpz8N5/iSsCn8wVp56km47YclfbwtHSzO6oDitgilsl/nfo3+yLjHuYeQ/3jpYu qprA== MIME-Version: 1.0 X-Received: by 10.182.55.72 with SMTP id q8mr1771958obp.96.1372256473378; Wed, 26 Jun 2013 07:21:13 -0700 (PDT) Sender: patrick.allaert@gmail.com Received: by 10.76.7.169 with HTTP; Wed, 26 Jun 2013 07:21:13 -0700 (PDT) In-Reply-To: References: Date: Wed, 26 Jun 2013 16:21:13 +0200 X-Google-Sender-Auth: FL63XSqTqOPChR_G8O-gDOyKUfM Message-ID: To: Julien Pauli Cc: Maxwell , Sherif Ramadan , Florin Patan , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Request for comments - new PHP feature: return typing From: patrickallaert@php.net (Patrick ALLAERT) 2013/6/26 Julien Pauli : > But what Sherif said proves as well the limits of the idea. PHP is not > strongly typed. So each check, should it be type hinting or return type > hinting, has to be done at runtime , which is bad for performances. It doesn't mean you have to use it, just that it might be used instead of implementing a manual check in every function/method callers, or, alternatively, in the function/method itself. Being done at runtime by the language will for sure not be worst for performance than doing it manually in pure PHP. > Not talking about the type juggling which could lead the programmer as > shooting himself. Sure! Hence why *if* this is taken into account, it should really be done the same way as it is done for input parameter hinting, to not introduce what we already don't want there.