Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78153 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85006 invoked from network); 19 Oct 2014 19:31:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Oct 2014 19:31:12 -0000 Authentication-Results: pb1.pair.com header.from=markus@fischer.name; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=markus@fischer.name; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fischer.name from 62.179.121.37 cause and error) X-PHP-List-Original-Sender: markus@fischer.name X-Host-Fingerprint: 62.179.121.37 fep17.mx.upcmail.net Solaris 10 (beta) Received: from [62.179.121.37] ([62.179.121.37:53416] helo=fep17.mx.upcmail.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/10-16395-A7114445 for ; Sun, 19 Oct 2014 15:31:07 -0400 Received: from edge02.upcmail.net ([192.168.13.237]) by viefep17-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20141019193103.IART12285.viefep17-int.chello.at@edge02.upcmail.net> for ; Sun, 19 Oct 2014 21:31:03 +0200 Received: from mail02.home ([213.47.1.174]) by edge02.upcmail.net with edge id 57X21p01j3lFLNl017X3Kg; Sun, 19 Oct 2014 21:31:03 +0200 X-SourceIP: 213.47.1.174 Received: from mail02.home ([192.168.1.14] helo=[IPv6:::1]) by mail02.home with esmtp (Exim 4.72) (envelope-from ) id 1XfwBx-0000X9-Gn for internals@lists.php.net; Sun, 19 Oct 2014 21:31:02 +0200 Message-ID: <54441174.5000303@fischer.name> Date: Sun, 19 Oct 2014 21:31:00 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam_report: Spam detection software, running on the system "scanner01.home", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On 16.10.14 06:39, Levi Morrison wrote: > - The design and accompanying section of reflection[3] has been > rewritten entirely. > > [3]: https://wiki.php.net/rfc/returntypehinting#reflection I've some comments about the Reflection API addition/changes: [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: Reflection-API (was: Re: [PHP-DEV] RFC: Return Types Update) From: markus@fischer.name (Markus Fischer) On 16.10.14 06:39, Levi Morrison wrote: > - The design and accompanying section of reflection[3] has been > rewritten entirely. > > [3]: https://wiki.php.net/rfc/returntypehinting#reflection I've some comments about the Reflection API addition/changes: 1. > "Note that getReturnType will always return a ReflectionType object, even if there is no return type declared." That feels weird, TBH. Other parts of the Reflection-API don't do that, they simply return false if I would call e.g. getParentClass() when there's none. 2. > "This API was designed so you could use ReflectionType::getKind() in a switch statement to cover all cases, rather than be forced to use an if/else structure that calls isArray(), isCallable, etc like the ReflectionParameter API does." I don't like the deviation from the existing Reflection API. I'm not saying it's perfect, but I fear a "haystack,needle vs. needle,haystack" thing here and would prefer the existing convention for is*() methods. I wouldn't see a conflict it providing both as I see the usefulness. 3. The new class is called "ReflectionType", shouldn't it be "ReflectionReturnType" ? 4. Other reflection classes, e.g. ReflectionParameter provides "missing link" methods, specifically I'm missing: public ReflectionClass getDeclaringClass ( void ); public ReflectionFunctionAbstract getDeclaringFunction ( void ); 5. I think, also like in ReflectionParameter, there should a direct shortcut to the class, if provided (and not just the string name): public ReflectionClass getClass ( void ); thanks, - Markus