Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78113 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9412 invoked from network); 16 Oct 2014 13:52:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Oct 2014 13:52:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.180 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.180 mail-vc0-f180.google.com Received: from [209.85.220.180] ([209.85.220.180:53522] helo=mail-vc0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7E/44-11594-09DCF345 for ; Thu, 16 Oct 2014 09:52:17 -0400 Received: by mail-vc0-f180.google.com with SMTP id le20so2690127vcb.39 for ; Thu, 16 Oct 2014 06:52:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=LZsNmQAtYP2RlZXWTx/xDo0U29Jkp7EZe1ujYlZY0uE=; b=DSk7UUkG5zSLxKE52sE6x4meezywEMeH5PEq/69vE26f4ATSBU+zFgQSm2RXyKE/40 IawJTd7lzTT5iQNjn0DDkxh1rFR178PqQD3Wt3L0YtZbk4yjBMEG+DZ6rmjDQuHpYusz RyuWSMmpq8SBYjTgbiM440BRPtjWK7CS5ovBTxdiGThv7Wn4n2HEFZBJ53cfsDzu+jkg OL/G1mR5vuEBoGZFe+xVeorYlQeWw9MlacQvouQiqWTH0XlkgVbSR53dRSoGg2YREDM+ a50P66G69Wv4IpeePWK9BIaz8DhqkmxtfidS9nNYU2sNHcmB1PY/dZdlMzzvAAtfAqpi IEuw== X-Gm-Message-State: ALoCoQlvPSuD4TkWwv4z7Xdm+sv0M7YtOCRb+8SquApaiIf4khR270PoI/qO2rWYUepsH/BKs00NIPofTDPy2RE306N/uqWmre43X+TC6/Z8DM36gMYt2nKKB8xHTe5oWKPs20VUkwcCgnkkl7ImvBG1Yyepx6SRFg== MIME-Version: 1.0 X-Received: by 10.52.251.136 with SMTP id zk8mr1095220vdc.51.1413467534329; Thu, 16 Oct 2014 06:52:14 -0700 (PDT) Received: by 10.52.4.41 with HTTP; Thu, 16 Oct 2014 06:52:14 -0700 (PDT) In-Reply-To: <38AD5222-CC19-4697-9F1A-B5AD21DB4C79@ajf.me> References: <38AD5222-CC19-4697-9F1A-B5AD21DB4C79@ajf.me> Date: Thu, 16 Oct 2014 17:52:14 +0400 Message-ID: To: Andrea Faulds Cc: Levi Morrison , internals Content-Type: multipart/alternative; boundary=001a1133ef24490da505058a8e42 Subject: Re: [PHP-DEV] RFC: Return Types Update From: dmitry@zend.com (Dmitry Stogov) --001a1133ef24490da505058a8e42 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I think the patch already does it (may be not for all magic methods). Thanks. Dmitry. On Thu, Oct 16, 2014 at 2:58 PM, Andrea Faulds wrote: > > On 16 Oct 2014, at 05:39, Levi Morrison wrote: > > > - There is a new section about disallowing return types on certain > methods[4]. > > Perhaps, along the same lines, we could error if you use a nonsensical > type hint for magic methods? > > For example, allow this: > > class FooBar { > public function __debugInfo(): array { > return [=E2=80=99test=E2=80=99]; > } > } > > But not this: > > class FooBar { > public function __debugInfo(): callable { > return [=E2=80=99test=E2=80=99]; > } > } > > It=E2=80=99s not strictly necessary, but it would catch out bugs at =E2= =80=9Ccompile-time=E2=80=9D > (i.e. script startup) rather than call-time. > -- > Andrea Faulds > http://ajf.me/ > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a1133ef24490da505058a8e42--