Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82691 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30235 invoked from network); 14 Feb 2015 15:34:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2015 15:34:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=pjsturgeon@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pjsturgeon@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.47 as permitted sender) X-PHP-List-Original-Sender: pjsturgeon@gmail.com X-Host-Fingerprint: 209.85.215.47 mail-la0-f47.google.com Received: from [209.85.215.47] ([209.85.215.47:41197] helo=mail-la0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 77/14-03565-31B6FD45 for ; Sat, 14 Feb 2015 10:34:44 -0500 Received: by labpv20 with SMTP id pv20so21326310lab.8 for ; Sat, 14 Feb 2015 07:34:41 -0800 (PST) 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:cc :content-type; bh=vkOoTvXDVxCAFwFufUIF9sBwdDTTqY3vN+ZtbtQktvE=; b=VdexdDnZT64qQfgV9yXBMRjFgkuIC99yVsRELDPflTTMG732yavOXDMIBdaJCDK3om XKvQNKSsuOQ0W+JnarLd6ASsDpcWGLhQgBRj656Inwd0BLtVo/t9+VQnUzYUhvnosT19 0di0fizHmhjL4cwk/A0wOGi2MbKz1QzzJPmG6Jd9SE65jCrp89miP702d8zQAfI8T1YM yJttYMS0EYagaT62F15LS64WUA3P45foDG2gU4n0pAb1Wi8/KR78J6AdRhWijDIrOwGk lPUe28VWTkR9ccMBcX7UihjzRLsLmvr9HDV+VmqfRwolhxLV++gAHCYWILp1tW9ZLX9M DQZw== MIME-Version: 1.0 X-Received: by 10.112.39.69 with SMTP id n5mr10510743lbk.1.1423928080991; Sat, 14 Feb 2015 07:34:40 -0800 (PST) Received: by 10.114.26.34 with HTTP; Sat, 14 Feb 2015 07:34:40 -0800 (PST) In-Reply-To: <746466D2-F3DB-4561-8C78-8685CC8F7EE7@ajf.me> References: <54CC8E81.3020104@beccati.com> <746466D2-F3DB-4561-8C78-8685CC8F7EE7@ajf.me> Date: Sat, 14 Feb 2015 10:34:40 -0500 Message-ID: Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC][DISCUSSION] ReflectionParameter::getClassName() From: pjsturgeon@gmail.com (Philip Sturgeon) On Sat, Jan 31, 2015 at 8:27 PM, Andrea Faulds wrote: > >> On 1 Feb 2015, at 01:23, Dan Ackroyd wrote: >> >> On 31 January 2015 at 17:31, Philip Sturgeon wrote: >>> On Sat, Jan 31, 2015 at 3:12 AM, Matteo Beccati wrote: >>>> >>>> 2) There's a tiny bit of overlap with "scalar type hints", >>> >>> 2) There might be some overlap in the scalar type hint stuff kinda, >>> but I'd like to think there isn't. getClassName() is just >>> getClass()->name >> >> >> I think Matteo's point is that if any scalar type RFC passes, a >> type-hint for a parameter would not always be the name of a class, so >> the method name 'getClassName()' would be misleading. >> >> It would be good to choose a better name to avoid that problem. > > We already have that problem (array, callable). > > I think the more important issue is the conflict with the ReflectionTypeAnnotation RFC, which proposes something similar to what was originally part of the Return Types RFC: > > https://wiki.php.net/rfc/reflectionparameter.typehint > > Thanks. > > -- > Andrea Faulds > http://ajf.me/ > > > > Hey, missed a few replies. 1. There is no conflict with scalar types at all. The class name is not a scalar type :) We already have getClass(), this is just getting the name of that class without loading it. > a type-hint for a parameter would not always be the name of a class, so the method name 'getClassName()' would be misleading. This wont be a problem Dan. getClass() wouldn't work if you call it on a `foo(string $bar)`, and this will fall over too. The test and RFC both show that. So, are we good to vote?