Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78117 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17987 invoked from network); 16 Oct 2014 15:06:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Oct 2014 15:06:13 -0000 Authentication-Results: pb1.pair.com header.from=guilhermeblanco@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=guilhermeblanco@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.179 as permitted sender) X-PHP-List-Original-Sender: guilhermeblanco@gmail.com X-Host-Fingerprint: 209.85.223.179 mail-ie0-f179.google.com Received: from [209.85.223.179] ([209.85.223.179:37196] helo=mail-ie0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 89/D5-11594-3EEDF345 for ; Thu, 16 Oct 2014 11:06:13 -0400 Received: by mail-ie0-f179.google.com with SMTP id ar1so3662200iec.10 for ; Thu, 16 Oct 2014 08:06:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=1Isk96sjyP92gscz369q3pf9LdKb6vJiBKliHl0hmyc=; b=MsqP20vUjedLBS59oVOASfgazXFtF6GoD6iDrfARXdn/6dL4ZDs7x3xD6cnDW+sfo4 T71aPiNwWWp5YMqZmsO7Zk/lZPZSMIAEowmJSvgMyaPhi+cfmzxQi+/Ihz5HeUVBL5hY OxqT3WsjMvVnKlCy8dbhssJbxFu8VhBSueIcQVYMzBct8OlWZEvaAGsN8j8NFpCnnP+A rtuuIhzKSHja3bE/QhvmovDURahcQ8xHSJouFZauBLDQFjvD+FXlo0HTF6op4tSgYDlb XPsFisGEJn4erGf9ZWg4t2FTySUn7YMgUJgrlHUQ9KZvZCz+cykGDJkaBHLCdHU0uyip Lamg== X-Received: by 10.50.141.197 with SMTP id rq5mr22279029igb.21.1413471965609; Thu, 16 Oct 2014 08:06:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.131.77 with HTTP; Thu, 16 Oct 2014 08:05:45 -0700 (PDT) In-Reply-To: References: Date: Thu, 16 Oct 2014 11:05:45 -0400 Message-ID: To: Nikita Nefedov Cc: Davey Shafik , internals Content-Type: multipart/alternative; boundary=089e0122f722690a1805058b96f7 Subject: Re: [PHP-DEV] RFC: Return Types Update From: guilhermeblanco@gmail.com ("guilhermeblanco@gmail.com") --089e0122f722690a1805058b96f7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Levi, This RFC is pretty consistent, small and focused on a specific part of the overall previously desired support. I do think many more subsequent RFCs would come up after this one to expand return typehint support, but as it stands right now is extremely good. Any further inclusion would drastically delay possible acceptance of this RFC and a possible withdrawn, since every piece left out are different discussion points. +1 so far. []s, On Thu, Oct 16, 2014 at 10:46 AM, Nikita Nefedov wrote= : > On Thu, 16 Oct 2014 18:39:06 +0400, Davey Shafik wrote: > > I very much like this =E2=80=94 though I would say it was dependent on t= he >> 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 Hack= s >> `$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` >> > > Hi, > > bar is considered as instance of foo so shouldn't be any problem. > Otherwise it would break LSP > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 Guilherme Blanco MSN: guilhermeblanco@hotmail.com GTalk: guilhermeblanco Toronto - ON/Canada --089e0122f722690a1805058b96f7--