Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38908 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47396 invoked from network); 10 Jul 2008 19:00:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jul 2008 19:00:41 -0000 Authentication-Results: pb1.pair.com header.from=lars@strojny.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=lars@strojny.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain strojny.net designates 78.46.69.2 as permitted sender) X-PHP-List-Original-Sender: lars@strojny.net X-Host-Fingerprint: 78.46.69.2 milch.schokokeks.org Received: from [78.46.69.2] ([78.46.69.2:42817] helo=milch.schokokeks.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B7/6E-11681-35C56784 for ; Thu, 10 Jul 2008 15:00:39 -0400 Received: from [192.168.0.100] (xdsl-87-79-211-3.netcologne.de [::ffff:87.79.211.3]) (AUTH: PLAIN lars@schokokeks.org, SSL: TLSv1/SSLv3,256bits,CAMELLIA256-SHA) by milch.schokokeks.org with esmtp; Thu, 10 Jul 2008 21:00:31 +0200 id 000000000000C006.0000000048765C4F.000010E3 To: Jochem Maas Cc: Derick Rethans , Gergely Hodicska , PHP Documentation List , "internals@lists.php.net" In-Reply-To: <48764379.3010304@iamjochem.com> References: <4875821E.9020504@avalon.aut.bme.hu> <20080710045418.GA22262@panix.com> <487599FA.9000207@avalon.aut.bme.hu> <4875CE7F.9090308@avalon.aut.bme.hu> <48764379.3010304@iamjochem.com> Date: Thu, 10 Jul 2008 21:00:30 +0200 Message-ID: <1215716430.9692.3.camel@localhost> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=_milch.schokokeks.org-4323-1215716431-0001-2" X-Mailer: Evolution 2.22.2 Subject: Re: [PHP-DOC] Re: [PHP-DEV] strange autoload behavior From: lars@strojny.net (Lars Strojny) --=_milch.schokokeks.org-4323-1215716431-0001-2 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Jochem, not that you really want it, but you could pass the exception as a static property to fully preserve and throw it later again. Something like this: ... sprintf('class %s { public static $e; public function __construct() { throw self::$e; } public function __call($method, array $args) { throw self::$e; } public function __callStatic($method, array $args) { throw self::$e; } }', $class); $class::$e =3D $e; ... Am Donnerstag, den 10.07.2008, 19:14 +0200 schrieb Jochem Maas: [...] > function __autoload($class) > { > try { > throw new Exception('foo'); > } catch (Exception $e) { =09 > self::handleDebug($e); > =09 > if (!class_exists($class, false)) > eval(sprintf(' > class %1$s > { > public function __construct() { t= hrow new AL_Exception("Class %1$s not found: %2$s"); } > public function __call($m, $a) { t= hrow new AL_Exception("Class %1$s not found: %2$s"); } > public static function __callStatic($m, $a) { t= hrow new AL_Exception("Class %1$s not found: %2$s"); } > }', $class, $e->__toString())); =09 > } > } >=20 > which works best when __autoload() isn't triggered by class_exists("Foo",= true) --=_milch.schokokeks.org-4323-1215716431-0001-2 Content-Type: application/pgp-signature; name="signature.asc" Content-Transfer-Encoding: 7bit Content-Description: Dies ist ein digital signierter Nachrichtenteil -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (GNU/Linux) iQIcBAABAgAGBQJIdlxOAAoJECQPF+sCY6wHqCAP/3WpznT8Amo9Fm8e4T68u9+o IOmlotZvVYWyGiuf5nhRQvcRHZwp4rpbHE7ivNI2iN0jRI+0TPF5c+FdfNEk44Ci ixIBPbPLg40bjQLbDQN3OMuMn33sQaukst6n5jB2Vthm3LHB0kH00ALf2OW4fNyw LWu8fm44ex2WS4ZRt8lmDrv1UmC8DDxHD0a+wJYWObH0Tj8OH3a9ZfL6xephtLDV nUrgY/CQMBfI4DY/HphQCv/i3ycTHEPTAHqkQdY4DTLGaKorAVhAwXti1xRQ2u82 Yty1d13tV0Ks9YI43J0UzpHZzlclMT9XSOkUU52PQB6d0CDYoQxZxhmxec3/0lvL kw4/Kg/u8SlRYVineBVhXNOjx0cYGrrhmLZRLIUpKbl46mPKQNJk4fgTjPtfTuZ4 SOuJTOWTY/dR0Aq05msMIu/AoP9D12DvMVKqDKAtRYf7GmpWqkcH49ppMtq8z/wW KtSRWS/SyW6IgLEq0ASj0eNdiGZ92/j6QdkG3kCpY4Sb1XFtzN9zZXoqm+QIQCWV vCD1wfyBQfT0ms5Rfs3VsdStb4AYD2JC3gfLyt5ST3SxFChdxQsZqfkrEVRxIKeB y9B2N+1BAk9oFBl9na3NX56a7nK0B/wB4QA9fkHDF3CJMxFX+UKPC/mxvGRizxV6 W+BWIhT6bty3BHMoaxCc =b7nU -----END PGP SIGNATURE----- --=_milch.schokokeks.org-4323-1215716431-0001-2--