Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94372 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35960 invoked from network); 4 Jul 2016 16:51:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jul 2016 16:51:36 -0000 Authentication-Results: pb1.pair.com smtp.mail=bjorn.x.larsson@telia.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=bjorn.x.larsson@telia.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain telia.com from 81.236.60.155 cause and error) X-PHP-List-Original-Sender: bjorn.x.larsson@telia.com X-Host-Fingerprint: 81.236.60.155 v-smtpout2.han.skanova.net Received: from [81.236.60.155] ([81.236.60.155:47805] helo=v-smtpout2.han.skanova.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8B/70-30328-6149A775 for ; Mon, 04 Jul 2016 12:51:35 -0400 Received: from [192.168.32.172] ([90.236.66.72]) by cmsmtp with SMTP id K75nbYrfrqtwZK75nbsXP0; Mon, 04 Jul 2016 18:51:31 +0200 To: Nikita Popov , Levi Morrison References: Cc: PHP internals Message-ID: <1f39f97a-6aaf-8550-9f82-a7e80465f903@telia.com> Date: Mon, 4 Jul 2016 18:51:30 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfAIWQ53SNLkOC0YfF14GRJNvFnvA6KoLf3UhBRw7kHQysluz3osTCqNZA6aqEnlT5vm4wejMnKHjlZKZ/W/ydixPYcqQ5eGChoHSA3wFhfVprNKDxiyA 7F/k31PAng7BgRG2SHG0+M02xyUWsdyFY6J4VU6Uhwy4miBMopM2AIfq2oHyUSIx5FpIqot/mMxaRn4EcgyL7CG6uZF+OUsfOZ5OSPv7K6uY4WvJ3iprWxQX bDZ1+7E+ZWNW2Qy2BSehsw== Subject: Re: [PHP-DEV] [RFC][Vote] ReflectionType Improvements From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) Den 2016-06-30 kl. 23:57, skrev Nikita Popov: > On Thu, Jun 30, 2016 at 6:06 PM, Levi Morrison wrote: > >> The RFC for improving ReflectionType[1] is now in voting phase. The voting >> window is June 30th through July 8th. I have not finished the patch but >> I'll have it done before the end of voting. >> >> [1]: https://wiki.php.net/rfc/ReflectionTypeImprovements > > Replying on-list as multiple people asked: > > I'm voting against this RFC, because it introduced not only the > ReflectionNamedType class (which is reasonable), but also the > ReflectionClassType class (which is not). > > My main objection to ReflectionClassType is that it is autoloading > dependent (*). Something like getReturnType() on a class type hint will > either return a ReflectionClassType if the class can be loaded, or a > ReflectionNamedType if it can't. I think this is confusing and I'm sure > that this will lead to broken code: For example, people will try to use > "$type instanceof ReflectionClassType" to check whether something is a > class type hint, while the currently correct way, which works independently > of class loading, is to check isBuiltin() instead. > > I don't think that most consumers of ReflectionType are interested in > obtaining a ReflectionClass for the type hint anyway (which is the only > functionality that ReflectionClassType provides), and if necessary this can > be easily done in userland. There is no need to over-complicate the > ReflectionType functionality in this manner, especially with the proposed > semantics. > > Nikita > Maybe one should split the vote into separate for each function. I mean pity if vote fails because one function is not attractive while the other one is... What do you think? Regards //Björn Larsson