Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79285 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70724 invoked from network); 28 Nov 2014 18:37:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Nov 2014 18:37:28 -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.220.172 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.172 mail-vc0-f172.google.com Received: from [209.85.220.172] ([209.85.220.172:44073] helo=mail-vc0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/11-59154-7E0C8745 for ; Fri, 28 Nov 2014 13:37:28 -0500 Received: by mail-vc0-f172.google.com with SMTP id hq11so3230679vcb.3 for ; Fri, 28 Nov 2014 10:37:23 -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=uorejaTPXk4+EQM2GcHmE0QaYsLc7VNstDrJl2sQfJ4=; b=ePTrbiPNS9KnB2Eu+HyvsB8y4cP2vh9tZUdHAw0XtmHyR7SpKbaNnR+uH8sf1NlrHa Id49qdz8B3thUAKIWSsgfCi70VK4gNA7x87k7KhjxWkUKjN9zkL2gZDmvlgl26erPQ1K XwlBJdYfSujLh+tTha/et3hfwG/9kvVtLyjqUdDAf4ckkr8bhH67r9zk+Q935KZYEZar vrixxiEcsUrjsE8rhsRHxXxRoUCZd1rBEEMwx0vX7EhimCMoZ61mdBgT4AzaxJzXV8kD vzUUGK/Y9D1UQCGefrOJMvAuLrwmD3bjqx5PjExuHZD0s+mo9aHgtjgirGuTMmee+OYX SpZg== X-Gm-Message-State: ALoCoQmaJa91Nqi0TJU2RcLd5PJSRbN6KS+OgvHpzXELB06HMc71CpEtdI2e78MSnUs2NIqvlyXA1xmS2VXaO2wRQeQDgUIRg/UcX9OTbobogkz7Q6vdOWpT1olT3I2RW5+d8ya1ryS1wS188XEmqjqmbk8XDy+9OQ== MIME-Version: 1.0 X-Received: by 10.52.117.161 with SMTP id kf1mr19384191vdb.65.1417199843740; Fri, 28 Nov 2014 10:37:23 -0800 (PST) Received: by 10.52.176.231 with HTTP; Fri, 28 Nov 2014 10:37:23 -0800 (PST) In-Reply-To: References: <5477010E.4000000@gmail.com> Date: Fri, 28 Nov 2014 22:37:23 +0400 Message-ID: To: Levi Morrison Cc: Rowan Collins , PHP Internals Content-Type: multipart/alternative; boundary=bcaec547cbdd4318320508ef8df7 Subject: Re: [PHP-DEV] [RFC][Discussion] Return Type Variance Checking From: dmitry@zend.com (Dmitry Stogov) --bcaec547cbdd4318320508ef8df7 Content-Type: text/plain; charset=UTF-8 Hi Levi, if you remember, in my patch return_type was actually stored in arg_info[-1]. it was mainly done for unification and to allow return type hinting for internal functions (they already use arg_info[-1]) So the strictures may be compatible. See https://gist.github.com/dstogov/8deb8b17e41c1a5abf88 I also thought about zend_string* usage in arg_info Please review the patch if you missed it. https://gist.github.com/dstogov/aa452a47ec30a8cb6eb5 The patches may be outdated, but they worked. I may care about the final implementation if you agree with invariant return type. Thanks. Dmitry. On Fri, Nov 28, 2014 at 7:51 PM, Levi Morrison wrote: > > I prefer option (3) - invariant return types. > > Actually, return type compatibility check should follow all the rules for > > parameter type compatibility check (may be even reuse or share the code). > > Realistically there isn't much code to share, especially since the two > structures are incompatible. That is, they are incompatible until > `zend_string *` is used in parameters (which I'm hopeful will happen). > --bcaec547cbdd4318320508ef8df7--