Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92651 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89517 invoked from network); 23 Apr 2016 07:46:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Apr 2016 07:46:44 -0000 Authentication-Results: pb1.pair.com header.from=jesseschalken@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jesseschalken@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.171 as permitted sender) X-PHP-List-Original-Sender: jesseschalken@gmail.com X-Host-Fingerprint: 209.85.223.171 mail-io0-f171.google.com Received: from [209.85.223.171] ([209.85.223.171:36603] helo=mail-io0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/91-01429-1682B175 for ; Sat, 23 Apr 2016 03:46:42 -0400 Received: by mail-io0-f171.google.com with SMTP id u185so140439721iod.3 for ; Sat, 23 Apr 2016 00:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=HTK8M8lRNZrGb/MDAPEEZZU20XozC+lTxNIf+ST9WMc=; b=XhqyNGkSang5eHXX1Z2z+C4fhBlz7E90/+o121CBWgtI4gGF3+jpBxE3mDUz19FLP0 ybd9j5IlO4o4M9OZHF2WWEHitOyfvr7Cu/tFQjPhQORKroQO/F78umiCvL5J1nhaqk++ 8/V5ky8JfxM9vRwOaS5IvQLU6vCPoPVcIuE0eJZGTi7za3X/l8sCYgjflBOtxXyVrSWc TyD3xMvE+M46ldqunUzbfirg2MQPx0te9D5nu3IjTsZplpCd8Mn3Ra0ncU0D8A3hT7lV 2JaBn6ceUFZRVgKHRl+duDwWIGZIYYp/8FgXYlltxBNQqlwJewOHOLl2wMwDGfrsVAX5 BrrA== 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; bh=HTK8M8lRNZrGb/MDAPEEZZU20XozC+lTxNIf+ST9WMc=; b=DumrBAmKb1G3PafZPXMCm5HxNZhiHJAn8oNP/M+nQwpgBRo8DS2xEYrp05tv+GJrzY CphGO+GDwp9iLZr9tiOgnzU7PLKqjwJpWfCT2Rqugvwo7mdhNMuhWDA0Y9ijEylbUFdW GtI4hlAPunDsVHEMqghYDVb5xN81sKHee+Yir+87C+7YRbrMrjVoh3izhdllCA5Hd2kS S2OMkvpkCH89TrKVIvr5ihnQK6StrDP+TzzgaonWMo2dEKmH5LnqIipikB6ExP8SiTkK 07YTSr2GpijxMvVFf69T1JWXDEVFzsfUarqV+nns8FSYfe9T2vHfqjCo982tEdRbUiAi ySAQ== X-Gm-Message-State: AOPr4FVxFK2foKLf5MGF4Aoh38Tcldawto1eVDJ54ieo0bpXhVhTd2jkV9tMqrrAv8uBk5hiDZBVxkhmP26STw== MIME-Version: 1.0 X-Received: by 10.107.137.101 with SMTP id l98mr27834570iod.31.1461397599014; Sat, 23 Apr 2016 00:46:39 -0700 (PDT) Sender: jesseschalken@gmail.com Received: by 10.79.139.133 with HTTP; Sat, 23 Apr 2016 00:46:38 -0700 (PDT) In-Reply-To: References: Date: Sat, 23 Apr 2016 17:46:38 +1000 X-Google-Sender-Auth: yI3SNjMIH-U3sOLaUXTEDry72ps Message-ID: To: Marcio Almada Cc: PHP internals Content-Type: multipart/alternative; boundary=001a113ed540c3daeb05312224ac Subject: Re: [PHP-DEV][RFC] Callable Types From: me@jesseschalken.com (Jesse Schalken) --001a113ed540c3daeb05312224ac Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This is great. The gaps in PHP's type annotations are slowly being filled. :) Are the rules for compatibility between callables the same rules for compatibility between methods in classes/interfaces? Because presently, this is allowed: interface Test { public function testMethod(); } function foo1(Test $x) { } foo1(new class implements Test { public function testMethod(int $extraParam =3D 0) { } }); but, according to the RFC, this would not be: function foo2(callable():void $x) { } foo2(function (int $extraParam =3D 0) { }); I don't see why they should be different. I also didn't see anything mentioning reference parameters/returns. I assume it just follows the rules for method compatibility? On Fri, Apr 22, 2016 at 2:12 PM, Marcio Almada wrote: > Hello everyone, > > We just completed the draft for the "Callable Types" RFC. This RFC has be= en > recently mentioned during other type related threads on this mailing list= , > so it feels to be the right time to put the proposal in context: > > The proposal is at https://wiki.php.net/rfc/callable-types > > The W.I.P patch is available for testing through http://3v4l.org under th= e > RFC tab. > > We count with your detailed feedback and insights. Let's have a nice, > respectful and > constructive conversation about the RFC and work on possible improvements= ! > > Thanks > Nikita Nefedov > M=C3=A1rcio Almada > --001a113ed540c3daeb05312224ac--