Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43881 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4218 invoked from network); 11 May 2009 10:34:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 May 2009 10:34:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=kalle.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kalle.php@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.220 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: kalle.php@gmail.com X-Host-Fingerprint: 209.85.220.220 mail-fx0-f220.google.com Received: from [209.85.220.220] ([209.85.220.220:48558] helo=mail-fx0-f220.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 84/B5-63646-92FF70A4 for ; Mon, 11 May 2009 06:34:18 -0400 Received: by fxm20 with SMTP id 20so2847283fxm.23 for ; Mon, 11 May 2009 03:34:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=wy/qCA3F1fvB8j7Dxooqrwhrv48TRfPJ/PVXL7fLayg=; b=a/XzYNNzIdZAXs2vvp68OEc4QaSteLlmwRlzVmR5o6DUC+2RdaStpPvoXctYqCreFE QwcJ4ikHqkI6CmatMrQqeNCP7NBWkjK6D6TcYOYTAonxLagDDGduDuTGygRtC0Xm0Ugp 4WdE9x+de60RcBiIAZ9aJOjBa/dt0PuASPgjA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=p2/4fTwZN2WYHDixoSVijjHxlw9MCdMSmbrrVDAcPg7ZJtCCL6/Da65HySbsCvSR+e G9qM0ztpf2Uw3dAS5oxT18WZBlFfs73mqmQrSzIVLXddKOrWNVqlENwQnQM8rz4jm5ig dLpDVumjWaI+AI6H1bkLOfjM2G8UAef6C3irE= MIME-Version: 1.0 Sender: kalle.php@gmail.com Received: by 10.204.53.141 with SMTP id m13mr6734335bkg.11.1242038054405; Mon, 11 May 2009 03:34:14 -0700 (PDT) Date: Mon, 11 May 2009 12:34:14 +0200 X-Google-Sender-Auth: f7c9a3b83e58583e Message-ID: <2dedb8a0905110334x1b546a2dv46a46ceca798a558@mail.gmail.com> To: Internals , Christian Seiler , =?ISO-8859-1?Q?Johannes_Schl=FCter?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Reflection From: kalle@php.net (Kalle Sommer Nielsen) Hello Internals I've been reading some over the reflection sources, and theres a few things that made me wonder abit; 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. 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? 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. 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. 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() 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) [1] http://pastie.org/474289 [2] http://pastie.org/474293 -- Kalle Sommer Nielsen kalle@php.net