Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74359 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67118 invoked from network); 19 May 2014 12:38:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 May 2014 12:38:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:52442] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/11-55232-E2BF9735 for ; Mon, 19 May 2014 08:38:07 -0400 Received: from [192.168.2.31] (ppp-93-104-13-198.dynamic.mnet-online.de [93.104.13.198]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id E9E18404CC; Mon, 19 May 2014 14:39:02 +0200 (CEST) To: Aaron Lewis Cc: Kris Craig , PHP Internals In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-PQjd1j9C5w4yk2IZdkiV" Date: Mon, 19 May 2014 14:37:54 +0200 Message-ID: <1400503074.2870.95.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Subject: Re: [PHP-DEV] Enumerate visible class names in current scope From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) --=-PQjd1j9C5w4yk2IZdkiV Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2014-05-19 at 17:04 +0800, Aaron Lewis wrote: > Hi Kris, >=20 > Thanks for the quick reply. I found class_table HashTable structure in > that zend function. >=20 > But, do you know how to tell between user-defined classes and predefined = ones? Please take a minute or two to try to find answers to such questions yourself. i.e. look at the class entry data structure, wonder whether the "type" element might be related, grep for it and see that it is set to either ZEND_INTERNAL_CLASS or ZEND_USER_CLASS. An alternative approach to figure this out is to think about a way to get this information from userspace, this should lead you to reflection, and that to the implementation of ReflectionClass::isUserDefined() in http://lxr.php.net/xref/PHP_TRUNK/ext/reflection/php_reflection.c#3574 Yes, the documentation is limited on these things but most things can be figured out with some research. If you researched and are unsure feel free to ask, and we are welcoming questions, but please mind that you are sending the questions to a few hundred persons trying to follow the PHP development ... Thanks johannes --=-PQjd1j9C5w4yk2IZdkiV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (SunOS) iQEcBAABAgAGBQJTefsiAAoJEH3sTmn8nIPXSxUH/A0vzUevVV0n9yf+SruldxTp 0w+h+Urqq3GZqiRMAU6VxD3EJQ3vzM0p4YC5pST6+A4flqcFtauLHLGl8iLTDO27 teyWkGelucpKV+4SC7JEe5k8WLW/kGcVMapTH0u+CT29g4MNvcvGw6lioul4VobP Fna/gV8iKPATBVeouahuMMORNw4lK+xgxZuRyjuAFk6H8Iy26XsWzPeX3jBflhPc Q8HQ7DEhBsH2/xibg36f3q4B6m1sPsqhKRs9Xq46HGcbLl32GK/GxvPRI4pIsk1I DyzDEvgk1HUYpk/3NO2CsJV+5aDBz2qEtePOkWmzXDH8Spif8U3yTNmXZGo4d8c= =OMn3 -----END PGP SIGNATURE----- --=-PQjd1j9C5w4yk2IZdkiV--