Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97144 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28318 invoked from network); 23 Nov 2016 11:07:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Nov 2016 11:07:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=dev@mabe.berlin; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=dev@mabe.berlin; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mabe.berlin from 80.237.132.167 cause and error) X-PHP-List-Original-Sender: dev@mabe.berlin X-Host-Fingerprint: 80.237.132.167 wp160.webpack.hosteurope.de Received: from [80.237.132.167] ([80.237.132.167:37892] helo=wp160.webpack.hosteurope.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E3/03-05808-66875385 for ; Wed, 23 Nov 2016 06:07:23 -0500 Received: from ec2-52-16-32-98.eu-west-1.compute.amazonaws.com ([52.16.32.98] helo=[10.8.0.22]); authenticated by wp160.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1c9VOU-0007Yz-Qf; Wed, 23 Nov 2016 12:07:14 +0100 To: internals@lists.php.net References: Message-ID: <87d52a15-5fbf-a6fe-fea3-638c24186d99@mabe.berlin> Date: Wed, 23 Nov 2016 12:07:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;dev@mabe.berlin;1479899243;dbc2e318; Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Object type hint, now with added variance From: dev@mabe.berlin (Marc Bennewitz) Am 23.11.2016 um 01:52 schrieb Dan Ackroyd: > Hi, > > This is the reintroduction of the Object Type RFC for discussion. > > There was previously strong feedback from people who would prefer that > the inheritance checks for methods that use object types should be > co/contravariant. This has been added to the RFC. > > https://wiki.php.net/rfc/object-typehint I like this RFC :) And I have a question where I'm not sure if that should be catched by this RFC, too: If I declare a return type of "object" and extends that to return "static" it doesn't compile because "static" is not a valid return type yet. https://3v4l.org/lp3AB/rfc#version=rfc-typed-properties class Test { public static function factory() : object { return new static(); } } class Test2 extends Test { public static function factory() : static { return parent::factory(); } } > > cheers > Dan > Ack >