Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67956 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69984 invoked from network); 27 Jun 2013 15:00:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jun 2013 15:00:29 -0000 Received: from [127.0.0.1] ([127.0.0.1:18950]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 9E/67-34034-C835CC15 for ; Thu, 27 Jun 2013 11:00:28 -0400 Authentication-Results: pb1.pair.com header.from=jbondc@gdesolutions.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jbondc@gdesolutions.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gdesolutions.com designates 216.32.181.186 as permitted sender) X-PHP-List-Original-Sender: jbondc@gdesolutions.com X-Host-Fingerprint: 216.32.181.186 ch1ehsobe006.messaging.microsoft.com Received: from [216.32.181.186] ([216.32.181.186:6799] helo=ch1outboundpool.messaging.microsoft.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 95/16-34034-F905CC15 for ; Thu, 27 Jun 2013 10:48:01 -0400 Received: from mail106-ch1-R.bigfish.com (10.43.68.235) by CH1EHSOBE010.bigfish.com (10.43.70.60) with Microsoft SMTP Server id 14.1.225.23; Thu, 27 Jun 2013 14:47:57 +0000 Received: from mail106-ch1 (localhost [127.0.0.1]) by mail106-ch1-R.bigfish.com (Postfix) with ESMTP id 395281401BC; Thu, 27 Jun 2013 14:47:57 +0000 (UTC) X-Forefront-Antispam-Report: CIP:132.245.2.69;KIP:(null);UIP:(null);IPV:NLI;H:BN1PRD0712HT003.namprd07.prod.outlook.com;RD:none;EFVD:NLI X-SpamScore: 2 X-BigFish: PS2(zzzz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6h10c0jz8dhzz31h2a8h668h839h944hd25hf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh15d0h162dh1631h1758h18e1h1946h19b5h19ceh1ad9h1b0ah1d07h1d0ch1d2eh1d3fh1de9h1dfeh1dffh1e1dh1155h) Received-SPF: softfail (mail106-ch1: transitioning domain of gdesolutions.com does not designate 132.245.2.69 as permitted sender) client-ip=132.245.2.69; envelope-from=jbondc@gdesolutions.com; helo=BN1PRD0712HT003.namprd07.prod.outlook.com ;.outlook.com ; Received: from mail106-ch1 (localhost.localdomain [127.0.0.1]) by mail106-ch1 (MessageSwitch) id 1372344475391068_29198; Thu, 27 Jun 2013 14:47:55 +0000 (UTC) Received: from CH1EHSMHS024.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.244]) by mail106-ch1.bigfish.com (Postfix) with ESMTP id 59C3D2400F7; Thu, 27 Jun 2013 14:47:55 +0000 (UTC) Received: from BN1PRD0712HT003.namprd07.prod.outlook.com (132.245.2.69) by CH1EHSMHS024.bigfish.com (10.43.70.24) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 27 Jun 2013 14:47:54 +0000 Received: from BN1PRD0712MB650.namprd07.prod.outlook.com ([169.254.8.2]) by BN1PRD0712HT003.namprd07.prod.outlook.com ([10.255.196.36]) with mapi id 14.16.0324.000; Thu, 27 Jun 2013 14:47:42 +0000 To: Anthony Ferrara CC: "internals@lists.php.net" Thread-Topic: [PHP-DEV] RFC: Protocol Type Hinting Thread-Index: AQHOcfelI2P2jDEJxkGUTfP2up+NEJlJnMUA Sender: Jonathan Bond-Caron Date: Thu, 27 Jun 2013 14:47:41 +0000 Message-ID: <6AA5D154FC52C047B1FF1CA3759A935B3CD88D29@BN1PRD0712MB650.namprd07.prod.outlook.com> References: <51C9FA9C.8050403@sugarcrm.com> <51CA1C93.6080500@sugarcrm.com> In-Reply-To: Accept-Language: en-CA, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [24.200.138.106] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: gdesolutions.com Subject: RE: [PHP-DEV] RFC: Protocol Type Hinting From: jbondc@openmv.com ("jbondc@openmv.com") >I agree the use-cases are slightly weak. This is a draft RFC. It's suppose= d to help identify=20 > the areas where we can improve it. Help identify use-cases. Help dig it o= ut. I think Ralph has the right idea: register_compatible_types($yourType, $myType); A better name might be (only for interfaces): register_instanceof($compatibleInterface, $interface); e.g. class ThirdParty { static foo(LoggerInterface $log) {} } class Bar implements My_Logging_Inferface {} echo (Bar instanceof LoggerInterface); // false register_instanceof('My_Logging_Inferface', 'LoggerInterface'); echo (Bar instanceof LoggerInterface); // true ThirdParty::foo(new Bar); // no error since 'My_Logging_Interface' is compa= tible with LoggerInterface In summary, it would allow for user-land registration of compatible interfa= ces to third party libraries. There's definitely a couple of use cases where I would have liked to use so= mething to this. Advantages to wrapping the feature in a function: - No extra syntax to support in core - No 'new concept' for developers to learn=20 - It can be disabled (which OO purists might like) disable_functions =3D register_instanceof