Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78115 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13779 invoked from network); 16 Oct 2014 14:39:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Oct 2014 14:39:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@daveyshafik.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=me@daveyshafik.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain daveyshafik.com from 209.85.223.179 cause and error) X-PHP-List-Original-Sender: me@daveyshafik.com X-Host-Fingerprint: 209.85.223.179 mail-ie0-f179.google.com Received: from [209.85.223.179] ([209.85.223.179:62910] helo=mail-ie0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 77/05-11594-D88DF345 for ; Thu, 16 Oct 2014 10:39:10 -0400 Received: by mail-ie0-f179.google.com with SMTP id ar1so3560987iec.38 for ; Thu, 16 Oct 2014 07:39:06 -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:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=UXGB3iZA2ubj7x2GAubt3vNH7FlaxOrN0Js8LD95wgg=; b=JSHCWs/bFcJ6aFtkrblzl4dFaeor/kcpnJWHmn6PuoXHeEWC2kSl4GhCteE0IwRb5P jsYV0qAQBuFbVfdGQJvbFrI2mZq5x4MXyg4tBciDrwGkw4Bh/jnYWYd0U6KYzoI2F5Fs sTB7WZhI/V1N3lV16tSu+RYRqHH7mC1uyYbQhbXgPVXMnKjWudyC1PeKXmB+ZRmsV5ZO ZmH+6Jh1YZCC5y4BN4fx/7zGgDb1unjX3AWmB5K5Ww3K/HGPwWJ0Urhdsa8uhhQ8kpmG vfcpBCWmlWEaOCTT7k4FrXjPOz2Ei7WHn51NP89VB8drlwz/LGzbg5F5vrMqlAjCci0B 4jTA== X-Gm-Message-State: ALoCoQknFgt23p+F7QkmMyRMBYcsPjekJLkPBJfJBv/h1kBlPC9/Z6w9C9dywWpEgcReUWwQStpi MIME-Version: 1.0 X-Received: by 10.50.70.40 with SMTP id j8mr5487319igu.31.1413470346671; Thu, 16 Oct 2014 07:39:06 -0700 (PDT) Sender: me@daveyshafik.com Received: by 10.107.135.1 with HTTP; Thu, 16 Oct 2014 07:39:06 -0700 (PDT) In-Reply-To: References: Date: Thu, 16 Oct 2014 10:39:06 -0400 X-Google-Sender-Auth: V7JrmcFr7bDLTZulNnJiMvtXwuk Message-ID: To: Levi Morrison Cc: internals Content-Type: multipart/alternative; boundary=047d7b3a9696ea145e05058b355a Subject: Re: [PHP-DEV] RFC: Return Types Update From: davey@php.net (Davey Shafik) --047d7b3a9696ea145e05058b355a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I very much like this =E2=80=94 though I would say it was dependent on the = nullable types RFC (like splat and variadics were codependent). While I would like to see the introduction of a void type, I understand and respect the limitations on the RFC. However, one thing that I do think is missing, is the equivalent of Hacks `$this` return type. You have `self` and `parent`, but I think without a `static` equivalent you can break things: class foo { static public function instanceOf(): self { return new static(); } } class bar extends foo { } foo::instanceOf(); // new foo, this is fine, returns `self`. bar::instanceOf(); // new bar, no longer `self` On Thu, Oct 16, 2014 at 12:39 AM, Levi Morrison wrote: > Dear Internals, > > I finally have a working implementation for return types RFC[1] built > on top of master. There are a few notes in the PR[2] about the > implementation. I invite you all to review the PR and provide > feedback. > > This means that I will soon move the return types RFC to voting phase. > If you have not yet had time to review the RFC recently I invite you > to do so now. > > The RFC has been slightly altered since the last discussion: > - The RFC now targets PHP 7 (previously PHP 5.7). > - There is a new section about disallowing return types on certain > methods[4]. > - The design and accompanying section of reflection[3] has been > rewritten entirely. > > Regardless of the result of the RFC, I want to thank the many people > who have been helpful to me as I have learned php-src and iterated > over this RFC. > > [1]: https://wiki.php.net/rfc/returntypehinting > [2]: https://github.com/php/php-src/pull/820 > [3]: https://wiki.php.net/rfc/returntypehinting#reflection > [4]: > https://wiki.php.net/rfc/returntypehinting#methods_which_cannot_declare_r= eturn_types > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --047d7b3a9696ea145e05058b355a--