Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78877 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96178 invoked from network); 12 Nov 2014 07:44:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Nov 2014 07:44:14 -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.214.174 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.214.174 mail-ob0-f174.google.com Received: from [209.85.214.174] ([209.85.214.174:54311] helo=mail-ob0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7A/43-02954-DCF03645 for ; Wed, 12 Nov 2014 02:44:14 -0500 Received: by mail-ob0-f174.google.com with SMTP id uz6so8724477obc.33 for ; Tue, 11 Nov 2014 23:44:11 -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=y98DAcYgMTdzvJoIhYtO450dHaLIJjE7MyGYQnL6yoM=; b=kQ0iB/CM/DxBXSViq19gOdqq9rCRNCRfMPEVrBJa0JWKVRcSy21UAeLS18DXpc5STT VE+cnjbON5hIDmASiNZLhWoSemDQ3Qnn57JntzCC+t7dxfpeonfPxsVKkyqw+v9ji94h 7qwBKUjFDlEe+6EvIm7CxJLkcL6bZMRTTvUBWVe1dMmvD8kWWSh9RFzi7bwyIolqKut+ 1A/VrxddxZWpr9Eq2El5NIkmFAFlOVwQHlRIKCHSCB5dyvj7xn7KjK2ui/haevXdno3J FyjvCiBuX5peFDEnXWWxjcKcX9FxoXC3zJc8ez8cx2LAw0IuYOeCSiqYHNUC1j4Tuhx+ x/2Q== X-Gm-Message-State: ALoCoQmtexkLAMe5hhlpOz0xwEe5x0Pjr8NyewSqMYdPubR1JQKcLqieh5BX3rpCB5ilDcP1JloGsAg06chMqN3BhSZqR0HIqgPClzJz90fD3sYla8d6/RNSWFRhOCis1hgCyE3TxRexomoVSYS5LSb4xyZjyMJ2Sw== MIME-Version: 1.0 X-Received: by 10.182.112.233 with SMTP id it9mr36711349obb.8.1415778250726; Tue, 11 Nov 2014 23:44:10 -0800 (PST) Received: by 10.60.70.41 with HTTP; Tue, 11 Nov 2014 23:44:10 -0800 (PST) In-Reply-To: References: Date: Wed, 12 Nov 2014 11:44:10 +0400 Message-ID: To: Levi Morrison Cc: internals Content-Type: multipart/alternative; boundary=089e0149cc0cb7390a0507a48f67 Subject: Re: [PHP-DEV] Re: [RFC][Vote Cancellation] Return Types From: dmitry@zend.com (Dmitry Stogov) --089e0149cc0cb7390a0507a48f67 Content-Type: text/plain; charset=UTF-8 On Fri, Nov 7, 2014 at 7:20 PM, Levi Morrison wrote: > > A bug was discovered in the implementation of the return types RFC[1] > > that cannot be fixed by the current implementation. A strategy for > > fixing the bug has been identified but alters some noticeable behavior > > in PHP-land. I do not want people to feel like I did a bait-and-switch > > move during voting phase, so I have cancelled the vote while this > > issue is being fixed. More information about the bug and the strategy > > for fixing it will be published soon. > > Here is some more information on the bug: > > The following code does a covariance check on B::foo(), because it > needs to ensure that C is compatible with its parent method A::foo(), > which returns a B. However, C does not exist at the moment that the > check is performed and an error is emited saying that it could not > find class C. If these were split into separate files and autoloaded > the current solution would work. > > class A { > function foo(): B {} > } > class B extends A { > function foo(): C {} > } > class C extends B { > function foo(): C {} > } > > Note that parameters do not have this issue because they are > invariant, meaning that inheritors have to exactly match the parent > type. I feel that covariance is a necessary feature for return types > It's not especially necessary. C# uses invariant return types. Thanks. Dmitry. > to work, so the voting has been cancelled while this is fixed. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --089e0149cc0cb7390a0507a48f67--