Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32567 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42923 invoked by uid 1010); 2 Oct 2007 19:25:30 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 42907 invoked from network); 2 Oct 2007 19:25:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Oct 2007 19:25:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 38.99.98.18 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 38.99.98.18 beast.bluga.net Linux 2.6 Received: from [38.99.98.18] ([38.99.98.18:53511] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/94-12743-92B92074 for ; Tue, 02 Oct 2007 15:25:30 -0400 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id 90404C0E1C1; Tue, 2 Oct 2007 12:25:26 -0700 (MST) Received: from [129.93.124.6] (pcp041067pcs.unl.edu [129.93.124.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id 136E8C0E1C0; Tue, 2 Oct 2007 12:25:25 -0700 (MST) Message-ID: <47029B22.4010205@chiaraquartet.net> Date: Tue, 02 Oct 2007 14:25:22 -0500 User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Marcus Boerger CC: internals Mailing List , johannes Schlueter References: <4701D607.7010405@chiaraquartet.net> <1411108822.20071002112931@marcus-boerger.de> In-Reply-To: <1411108822.20071002112931@marcus-boerger.de> X-Enigmail-Version: 0.95.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [PHP-DEV] link to exceptions in autoload thread? From: greg@chiaraquartet.net (Greg Beaver) Marcus Boerger wrote: > Hello Gregory, > > I don't recall any particular thread but Andi once explained why a few > things are instable when exceptions are pending. Some of that is no longer > the case so maybe it is time to reinvestigate the whole issue of pending > exceptions. But maybe that would result in an exception stack like in Java > and I am not sure whether I would not simply favor our current bahavior. Hi, I actually don't mind the current behavior, although it would be nice if instead of an E_ERROR it simply displayed the exception as if it were uncaught (ignoring the exception handler - just shunt and display as an Exception would). Even this is not a big issue, I've been using die(new Exception(...)) and it does the same thing. What I was wondering is to understand __autoload()s internals a little better. Your message plus my investigation of the source leads me to ask a pre-patch question: I'd like to avoid my little fatal error trick if the user simply called class_exists('Classname', true) and same for interface_exists(). If I provide a simple patch that would introduce a new HashTable of classnames into EG() called EG(in_class_exists), and a new userspace function in_class_exists() that returns true if __autoload() was called by class_exists(), would that be an acceptable addition into PHP 5.3? This way, my autoload handler could simply return if the user is querying the existence of a class, and die pre-emptively with the exception I want in other cases where an E_ERROR would result. This feature would be extremely useful for PEAR2's implementation of autoload. Currently, I check the stack frame of the exception for class_exists() prior to die()ing with it, which is risky at best, and a performance hog. Thanks, Greg