Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78718 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28740 invoked from network); 5 Nov 2014 11:53:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2014 11:53:56 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.214.173 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.214.173 mail-ob0-f173.google.com Received: from [209.85.214.173] ([209.85.214.173:47210] helo=mail-ob0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FB/F2-10214-3DF0A545 for ; Wed, 05 Nov 2014 06:53:55 -0500 Received: by mail-ob0-f173.google.com with SMTP id wn1so409410obc.4 for ; Wed, 05 Nov 2014 03:53:53 -0800 (PST) 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=dRCX7kkx/JLigBXO9cYJ/AiFmAxEjSFUP9ZRt3e5OC0=; b=KkghZxMS9F4ttK04h+O8eKoscgn4VExWad0v59cvfdE3v0J1e5NYBdoRq5dHwhIezR vCBYyz0EC4vNDaEanTc2+RHm2Bqn8AuzHwWWhjq/yu3VdUz8jvaUV/1vhKvC2ixL1MgP 2lWhgHgP354YrU3ctlXz4CUcExWXsVvyMvwSB8471brODdq0AZLYk01882OJaMztsNSe iF0EPxl6uhkl8N09iASS0gU+LFqikORWY+Mnw7CemY/iKT8flmRs2txU4IpvUM9MTFF8 AHK7efTaV5Jwd3Qiw+CcCh8jMqnliF117jEUOKXJBFd60iIhjS2yeyncsbPBkXvhgBuE ZEPg== X-Gm-Message-State: ALoCoQn1AfqplDsyf4OfpWyBZ39kftZuFmZXjrFFiqthJ2WpK3KatMGWjQDmGqZgkQitrzWaRpOmwWtIqURvPDk5+usiDEXBK5pMHytG2eVdJU+XSGU3UQ9e/s8lljtPPiRxtrUD+VnYYv2OHJH2hSxkwqwCn6zphw== MIME-Version: 1.0 X-Received: by 10.202.225.212 with SMTP id y203mr24523785oig.16.1415188432900; Wed, 05 Nov 2014 03:53:52 -0800 (PST) Received: by 10.60.70.41 with HTTP; Wed, 5 Nov 2014 03:53:52 -0800 (PST) In-Reply-To: References: Date: Wed, 5 Nov 2014 15:53:52 +0400 Message-ID: To: Levi Morrison Cc: internals , Nikita Popov Content-Type: multipart/alternative; boundary=001a113d2dfed5715305071b3b3b Subject: Re: [PHP-DEV] [RFC][Vote] Return Types From: dmitry@zend.com (Dmitry Stogov) --001a113d2dfed5715305071b3b3b Content-Type: text/plain; charset=UTF-8 Hi Levi, The patch is here https://gist.github.com/dstogov/8deb8b17e41c1a5abf88 I improved memory consumption and unified return type-hinting error behavior with existing argument type-hinting. The main semantic must be unchanged. I also removed part of Reflection changes. I think we should remove even more and later introduce similar APIs for both argument and return type-hinting at once. Working on the patch I found few problems. 1) Return type-hinting for generators in existing state is useless. We may use it for checking "yield" value instead of "returned" or just disable it for now. 2) "Covariant" return type check is really problematic. It delays class binding to run-time, and requires all classes, used in hints, to be loaded. I would prefer to simplify this by using "Invariant" return types (similar to arguments) and checking just class names (without their loading). Thanks. Dmitry. On Tue, Nov 4, 2014 at 5:01 AM, Levi Morrison wrote: > Dear Internals, > > I am pleased to announce that the return type RFC is now open for > voting[1]. Note that the implementation needs a bit of cleaning up > before merging should the RFC be accepted; Dmitry has already > volunteered to help with that, but more eyes are welcome. > > A couple of things have changed in reflection[2] since the last > iteration, but is otherwise the same. > > The implementation is slightly out of date with the RFC, but soon it > will be updated to match. > > [1]: https://wiki.php.net/rfc/returntypehinting#vote > [2]: https://wiki.php.net/rfc/returntypehinting#reflection > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a113d2dfed5715305071b3b3b--