Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57567 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84507 invoked from network); 30 Jan 2012 11:15:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jan 2012 11:15:45 -0000 Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.211.66 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.211.66 config.schlueters.de Received: from [217.114.211.66] ([217.114.211.66:32972] helo=config.schlueters.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7F/B2-53934-0EB762F4 for ; Mon, 30 Jan 2012 06:15:45 -0500 Received: from [192.168.2.230] (unknown [188.174.45.17]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by config.schlueters.de (Postfix) with ESMTPSA id 7C42E605B7; Mon, 30 Jan 2012 12:15:41 +0100 (CET) To: Ryan McCue Cc: internals@lists.php.net In-Reply-To: <4F25F6E5.3050404@rotorised.com> References: <1327883576.6780.722.camel@guybrush> <4F25F6E5.3050404@rotorised.com> Content-Type: text/plain; charset="UTF-8" Date: Mon, 30 Jan 2012 12:15:36 +0100 Message-ID: <1327922136.1876.181.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] ReflectionFile missing From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Mon, 2012-01-30 at 11:48 +1000, Ryan McCue wrote: > Johannes Schlüter wrote: > > PS. Mind that the example you've given even works on files not included > > by parsing files, whereas internal reflection provides information what > > actually is available from engine point of view ... > > The original reason I wrote that class was for a documentation tool, so > that we could discover classes before loading the files. Right, I can see the need. But I think it is a different project from the simple "ReflectionFile" thing, as long as that is supposed to work with the current reflection system. Doing a "static reflection" from inside PHP is not easy as currently the parser is bound quite tight to the engine and our compiler, directly affecting function and class tables. We'd have to split that out and even if we do that there's one benefit(*) when doing it in PHP userland: It will always be bound to valid syntax for the given PHP interpreter. It won't work cross-version when we change the language. (so running 5.3 you couldn't analyze 5.4 code which might use traits etc.) a userland implementation can be made version independent and updated with support for new versions without breaking support for the old version. Of course doing this in userland means cost of performance, but I expect that IO on the one side and client code using the analyzed data on the other side have a bigger impact and the difference can almost be neglected, but that's a guess. As a remark, there's another static reflection project: https://github.com/manuelpichler/staticReflection maybe you can work together? To create the best :-) johannes *) of course there are all those other benefits of writing userland code like being simpler for the user to understand and debug, being simpler to maintain, which means more potential contributors, ...