Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67812 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53468 invoked from network); 25 Jun 2013 16:24:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jun 2013 16:24:04 -0000 Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.170 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.128.170 mail-ve0-f170.google.com Received: from [209.85.128.170] ([209.85.128.170:54779] helo=mail-ve0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EE/25-49518-324C9C15 for ; Tue, 25 Jun 2013 12:24:04 -0400 Received: by mail-ve0-f170.google.com with SMTP id 14so10368312vea.1 for ; Tue, 25 Jun 2013 09:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=FWTfWvmDjzKBRZ9hcRfgcfWwD7GhPoIlcy3R63n5RUI=; b=r3BFc8CflhNPBvno5j9x/s212fC95XQ7MugFokOcPxqSwRUyph2nDBGxlk6Boun8am MR78Ho7IVOMW/iG+Zx6h0UbF3S5/VFzJNnfCiAZWCIpHR6rjvLZ+eCRVod8PFItD4gXH xsiMkafDnctl0bkpqetAMAOD0YRf95eC5czVdNnpEOA146TshLSZOjiBY5E9XmvPIQoE CKTN3aurOP52Kn7lAtx7bQsCeVcfbXTnXPVFz/N91kroH2UoyeaAmT2zUfxt/tIFfU7W LgQWXKocStAqDt28iHG8BarhWm+C1z+FCJqn6mOu4bp9/GMG+AXwi/QnNCGl45wwJ7ZO CkVg== MIME-Version: 1.0 X-Received: by 10.220.191.5 with SMTP id dk5mr14319760vcb.47.1372177441147; Tue, 25 Jun 2013 09:24:01 -0700 (PDT) Received: by 10.58.94.201 with HTTP; Tue, 25 Jun 2013 09:24:01 -0700 (PDT) In-Reply-To: References: Date: Tue, 25 Jun 2013 12:24:01 -0400 Message-ID: To: Nikita Nefedov Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c1bfaaf2d37e04dffcf499 Subject: Re: [PHP-DEV] RFC: Protocol Type Hinting From: ircmaxell@gmail.com (Anthony Ferrara) --001a11c1bfaaf2d37e04dffcf499 Content-Type: text/plain; charset=ISO-8859-1 Nikita, Thanks for the response! By looking at the diff I see it will only work for type-hints in > functions/methods. Could we also see something like "$var instanceof > "? I fear it can't be done this way because of parser > limitations, but I believe this feature would be as useful as type-hinting > in functions. > Well, we could add a new construct "$var protocolof Proto" or "$var actsasa Proto" or something. I wouldn't conflate instanceof with this behavior for two reason: instanceof implies type checking. This is not type checking. Second, instanceof can be used with a variable ont he right side. SO this could get awkward... As to the name of the construct, I am at a loss... But I'm sure we can come up with something interesting... Anthony --001a11c1bfaaf2d37e04dffcf499--