Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67818 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77622 invoked from network); 25 Jun 2013 18:48:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jun 2013 18:48:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=ralph@ralphschindler.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ralph@ralphschindler.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain ralphschindler.com from 209.85.213.54 cause and error) X-PHP-List-Original-Sender: ralph@ralphschindler.com X-Host-Fingerprint: 209.85.213.54 mail-yh0-f54.google.com Received: from [209.85.213.54] ([209.85.213.54:59055] helo=mail-yh0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E2/7A-49518-4E5E9C15 for ; Tue, 25 Jun 2013 14:48:05 -0400 Received: by mail-yh0-f54.google.com with SMTP id f73so5917200yha.41 for ; Tue, 25 Jun 2013 11:48:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=2tA90pediDut/uAPcvFmGgFlmIRiaA0AEZL3WaDD47s=; b=i/a3XyeoLPQiy6r+4OV2bO3Rd8xvUCIfGIk9+nFNvrlPdXwZs4l5jFspDURu8uaS9n nHdCKlT4fm0nZ/GKJx6F5xF6i+4/bBw6qXLdp8IQnMX+vgztSp4suO+VcpxtFBFoY8ym XASo/9ylRWhwTAC68RSlHBo0yXlsX9sVhJbyw7mAOOcrNGzgGgpPuwDruC0MYS/x/Ctw 2LnI8RK1zsnsChKBBgW9SWUfdDbk3mSUe2tcDpUIUvJY0LApTbhz10Ys7mSVg+NpElzR P2H5+BDFTyWrovD+eqQBbsXpudlHXl4QIL4BDNk1KXaX1wwAt4t57q4virSqb85KcUKk Hk4Q== X-Received: by 10.236.70.198 with SMTP id p46mr236869yhd.87.1372186081951; Tue, 25 Jun 2013 11:48:01 -0700 (PDT) Received: from Ralphs-Mac-Pro.local (ip174-73-14-247.no.no.cox.net. [174.73.14.247]) by mx.google.com with ESMTPSA id d91sm39500064yhq.16.2013.06.25.11.48.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Jun 2013 11:48:01 -0700 (PDT) Message-ID: <51C9E5DF.9080104@ralphschindler.com> Date: Tue, 25 Jun 2013 13:47:59 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnIdUNwIQq4y9PdGrlY04BTSNOnec5HcTZta1KxdqaCAC9j8dEyIq6IZkMSuKdcpqIxgiLh Subject: Re: [PHP-DEV] RFC: Protocol Type Hinting From: ralph@ralphschindler.com (Ralph Schindler) Anthony, I like it. The one thing that is lacking in the PHP ecosystem is some kind of support for a "Gentleman's Agreement" when it comes to APIs. I am very much opposed to central bodies of code and/or shared interfaces (like the PSR-3's et. al.) for seemingly simple and cross-cutting APIs. An idea I had been kicking around, if yours in full does not pass the muster, was adding a function to do something similar (also requires changes to the instanceof checks in the engine): register_compatible_types($yourType, $myType); which basically would allow any of $myTypes (My\LoggerInterface) to pass when the engine is testing for instanceof $yourType. I do hope we get something like either of these solutions for PHP.next. -ralph On 6/25/13 10:57 AM, Anthony Ferrara wrote: > Hey all, > > I want to throw out this draft RFC to get the concept floating around and > get feedback early. > > https://wiki.php.net/rfc/protocol_type_hinting > > There are still open questions, and a more complete (and cleaner) > implementation will be needed before officially proposing it, but I wanted > to get the concept out as soon as possible. > > What do you think? > > Thanks! > > Anthony >