Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15815 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7522 invoked by uid 1010); 5 Apr 2005 14:55:23 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 7503 invoked from network); 5 Apr 2005 14:55:23 -0000 Received: from unknown (HELO php.net) (127.0.0.1) by localhost with SMTP; 5 Apr 2005 14:55:23 -0000 X-Host-Fingerprint: 69.64.38.41 bluga.net Linux 2.5 (sometimes 2.4) (4) Received: from ([69.64.38.41:52316] helo=bluga.net) by pb1.pair.com (ecelerity HEAD r(5268)) with SMTP id E4/69-19272-AD6A2524 for ; Tue, 05 Apr 2005 10:55:22 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by bluga.net (Postfix) with ESMTP id C74EE21C9AB; Tue, 5 Apr 2005 09:52:57 -0500 (CDT) Received: from bluga.net ([127.0.0.1]) by localhost (bluga.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05746-04; Tue, 5 Apr 2005 09:52:57 -0500 (CDT) Received: from [192.168.0.102] (cpe-66-65-39-8.nyc.res.rr.com [66.65.39.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by bluga.net (Postfix) with ESMTP id 38BD921C848; Tue, 5 Apr 2005 09:52:57 -0500 (CDT) Message-ID: <4252A6D0.7070005@php.net> Date: Tue, 05 Apr 2005 10:55:12 -0400 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Marcus Boerger Cc: Andrey Hristov , Stanislav Malyshev , internals@lists.php.net References: <5.1.0.14.2.20050403125628.03f83de0@localhost> <425002D8.50004@php.net> <42515CFC.2050108@php.net> <42516F85.10803@hristov.com> <425181BF.4090403@php.net> <1325222760.20050405054311@marcus-boerger.de> In-Reply-To: <1325222760.20050405054311@marcus-boerger.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at bluga.net Subject: Re: [PHP-DEV] Re: __autoload() enhancement From: cellog@php.net (Greg Beaver) Marcus Boerger wrote: > Hello Greg, > > Monday, April 4, 2005, 2:04:47 PM, you wrote: > > >>Andrey Hristov wrote: >> >>> Stanislav, >>>Greg probable means something like a stack trace of the autload callbacks >>>that were called. This will be a nice addition just like Exception >>>stacktraces >>>are (I wish there were stacktraces for Fatal errors). > > >>yes, a stack trace would be ideal - I knew there was a name for that >>thing I was describing :) > > > A stack trace is only some additional information that has no real added > information. Also it is not a real stack trace since what you asked is > just a list of functions called at one level and not the trace up to > that part where a class was missing (which would be a stack trace). I imagined that a failed __autoload() would leave the old on one the call stack, as if the user had inserted the call to the new __autoload() before the last closing }. > After my last commit you can get a stack trace by throwing an exception > in the last called function. To get a list of all functions being called > just check spl_autoload_functions(). The exception solution will only work if the user puts a throw() in there. The list of functions would be more useful, imo. > A combination of both would require the engine to be changed to be capable > of handling multiple exceptions - which hopefully we do not want. Right > now a second exception while an exception is already pending results in a > fatal error. I don't think putting exceptions into __autoload is a good idea at all, the only use exceptions serve is to bubble out of contexts, whereas an undefined class will simply error out. Simpler is to provide an option for users to define an error handler that can display the __autoload() functions used with some kind of listing function, whether it is spl_autoload_functions() or an engine feature. Greg