Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43894 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16805 invoked from network); 12 May 2009 07:52:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 May 2009 07:52:15 -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:34168] helo=mail-fx0-f220.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7A/B0-05302-DAA290A4 for ; Tue, 12 May 2009 03:52:14 -0400 Received: by fxm20 with SMTP id 20so3484530fxm.23 for ; Tue, 12 May 2009 00:52:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=XVVL34rch3WvvxgUFMQZToOfJufQRL5dh3qSrdGea5Q=; b=M7W3H74XcwXmeGutwV98GXbxAG24Mjrzyk3Ka9z11oEixEJyJMKLKu0DNTt9SfHhSi aoyCPNP6W5f4V9ChYJOl4tH1NemyP2vnQ6tiqqxgKf5h32t1O0nJnTr1LbcOD5JmGr8l VmlTdVA54NDDX2DwKyakhe0Ek4vfhPZyTENZs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=o+w3HehkQIDwWSn456844qu2dANpWq2W0s7ALspQF2aI2to7TsR1TxeiV74lBTHXgk BDVLGMLMEp6xLRybGHPKSAL2OWHFc7IiyVy0YI2uNKEp/jUB1OId2ejahn77w8M8/PdR Z5VPHE/sh9G4cwwf5Ktw9HGDvN70JWiACxrLU= MIME-Version: 1.0 Sender: kalle.php@gmail.com Received: by 10.204.116.69 with SMTP id l5mr7818310bkq.102.1242114730517; Tue, 12 May 2009 00:52:10 -0700 (PDT) In-Reply-To: <1242044291.6298.16.camel@goldfinger> References: <2dedb8a0905110334x1b546a2dv46a46ceca798a558@mail.gmail.com> <1242044291.6298.16.camel@goldfinger> Date: Tue, 12 May 2009 09:52:10 +0200 X-Google-Sender-Auth: b7c766bb567f3f8e Message-ID: <2dedb8a0905120052s67aef67frc851e67ac3433918@mail.gmail.com> To: =?ISO-8859-1?Q?Johannes_Schl=FCter?= Cc: Internals , Christian Seiler Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: Reflection From: kalle@php.net (Kalle Sommer Nielsen) Hi Johannes 2009/5/11 Johannes Schl=FCter : > (re-sending, sorry if this arrives twice) > > Hi, > > 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. We can always just merge it in 5.3.1 if your fine with it, seems stupid to have a method there in a branch which isn't anywhere soon (but hopefully im wrong), but nonetheless. > > Didn't take a look at the code so can't say much > > At least getClosureThis() depends on $this handling which was reverted > from 5.3. > Not sure what getClosure() does. As said on irc, then yea getClosure() can be used to create a closure of the function instance: function greet($who) { echo 'Greetings ' . $who; } $rf =3D new ReflectionFunction('greet'); $greet =3D $rf->getClosure(); $greet('Johannes'); I will have a look and reply to Christians mail once I've read and understood the $this handling with closures, but I sort of see why its not reverted there yet. > > 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. It just seems odd that we have reflection for almost class, function etc. elements but not namespaces, whereas it could be so simple as: class ReflectionNamespace { public $name; public $absolute_path; public function __construct($absolute_path_or_inherited_name); ReflectionClass[] public function getClasses(); ReflectionFunction[] public function getFunctions(); array public function getConstants(); int public function getLine(); string public function getFile(); bool public function isAutoLoaded(); /* etc */ } And then change inNamespace() to return: ReflectionNamespace public function inNamespace() or add an additional parameter/method to do so. > > > I was under the impression this was possible, or is it only printed by > export()? I see it being printed in _extension_string(), but I don't see any other references to how you may obtain that value. But if you like I can add it (perhaps together with getDefaultValue) in 5.3.1. > > > 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. After looking some more on it, then I agree, however the isDynamicLoaded might be somewhat useful. > > johannes > > > --=20 Kalle Sommer Nielsen kalle@php.net