Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43884 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27121 invoked from network); 11 May 2009 13:06:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 May 2009 13:06:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.243.58.134 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 83.243.58.134 mailout2.netbeat.de Linux 2.6 Received: from [83.243.58.134] ([83.243.58.134:35697] helo=mailout2.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 51/F0-21821-2C2280A4 for ; Mon, 11 May 2009 09:06:12 -0400 Received: (qmail 7387 invoked by uid 89); 11 May 2009 12:47:13 -0000 Received: from unknown (HELO ?192.168.1.102?) (johannes%schlueters.de@88.217.49.225) by mailout2.netbeat.de with ESMTPA; 11 May 2009 12:47:13 -0000 To: Kalle Sommer Nielsen Cc: Internals , Christian Seiler In-Reply-To: <2dedb8a0905110334x1b546a2dv46a46ceca798a558@mail.gmail.com> References: <2dedb8a0905110334x1b546a2dv46a46ceca798a558@mail.gmail.com> Content-Type: text/plain Date: Mon, 11 May 2009 14:18:10 +0200 Message-ID: <1242044291.6298.16.camel@goldfinger> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 Content-Transfer-Encoding: 7bit Subject: Re: Reflection From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) (re-sending, sorry if this arrives twice) Hi, On Mon, 2009-05-11 at 12:34 +0200, Kalle Sommer Nielsen wrote: > 1) ReflectionParameter::getDefaultValue(), was added to HEAD in 2006, > but never merged to a stable branch? I made a backport of the function > to 5.3 [1] which I think we should merge, whether its gonna be 5.3.1 > or what. This should be low risk as it's a self-contained function and we all est HEAD ... but I'd prefer not adding anything but bug fixes to 5.3 as it already took way too long. > 2) _default_lookup_entry() is commented out by a macro in HEAD but is > used in 5.3, and the only difference is the zend_hash_find -> > zend_u_hash_find call for unicode? Didn't take a look at the code so can't say much > 3) Closures, theres alot of closure differences in HEAD and 5.3, for > example HEAD has ReflectionMethod::getClosure() and > ReflectionFunction::getClosureThis(), but 5.3 does not, which makes it > looks like a change in 5.3 that never occured to HEAD, unless that is > the logic is fixed in HEAD. We should really fix this, so 5.3 have > these if needed. At least getClosureThis() depends on $this handling which was reverted from 5.3. Not sure what getClosure() does. > 4) How about an ReflectionNamespace, to analyze a namespace? Since > theres no real way to use reflection on namespaces other than the > "isNamespace" methods etc. We have no real namespace meta-data available, the only way doing things there would be by iterating over the class table and parsing the class names. Not usre that's really a good thing to do. > On a related note, I'd also like to propose an addition for > reflection, whether its 5.3.1 or what (since we're so late in 5.3, > theres no need to push more features), this is 3 new methods to the > ReflectionExtension class[2]: > > ReflectionExtension::isDynamicLoaded() - Returns if an extension was > loaded through dl() I was under the impression this was possible, or is it only printed by export()? > ReflectionExtension::getBuildId() - Gets the zend build id (added in 5.3) > ReflectionExtension::getAPINo() - Gets the zend api no that the > extension was compiled for (may not really be needed, since the number > doesn't change very often nor may be of any real use) I don't think this belongs to that class as these values should match the one PHP was compiled with, so I think this should be a global function. johannes