Re: [PHP-DEV] strange autoload behavior

2008-07-19 Thread Marcus Boerger
Hello Jochem, Thursday, July 17, 2008, 7:38:01 PM, you wrote: > Marcus Boerger schreef: >> Hello Jochem, >> > ... >>> I just posted another mail to internals in which I attempt to detail the >>> __autoload behaviour 'issues' ... it includes something that wants to be a >>> test suite when it g

Re: [PHP-DEV] strange autoload behavior

2008-07-17 Thread Lukas Kahwe Smith
On 17.07.2008, at 19:38, Jochem Maas wrote: 1. I don't know .phpt (I can solve this) its quite easy. if you have questions either send them to [EMAIL PROTECTED] or join us in #php.pecl on efnet or #phptestfest on freenode respectively. 2. I have no idea what to expect and therefore tes

Re: [PHP-DEV] strange autoload behavior

2008-07-17 Thread Jochem Maas
Marcus Boerger schreef: Hello Jochem, ... I just posted another mail to internals in which I attempt to detail the __autoload behaviour 'issues' ... it includes something that wants to be a test suite when it grows up ... it might help someone to investage/determine what __autoload() does/sh

Re: [PHP-DEV] strange autoload behavior

2008-07-17 Thread Marcus Boerger
Hello Jochem, Thursday, July 17, 2008, 12:03:42 PM, you wrote: > Hi Marcus, > Marcus Boerger schreef: >> Hello Jochem, >> >> seems like we have quite some nice additions to the manual here in this >> thread. Now to the real issue, Exceptions don't bubble up. > The thing is under quite a few

Re: [PHP-DEV] strange autoload behavior

2008-07-17 Thread Jochem Maas
Hi Marcus, Marcus Boerger schreef: Hello Jochem, seems like we have quite some nice additions to the manual here in this thread. Now to the real issue, Exceptions don't bubble up. The thing is under quite a few circumstances the Exceptions do bubble up, and there is another issue with __au

Re: [PHP-DEV] strange autoload behavior

2008-07-15 Thread Marcus Boerger
Hello Jochem, seems like we have quite some nice additions to the manual here in this thread. Now to the real issue, Exceptions don't bubble up. That is they are simply ignored. And once all __autoload work is done and the class still doesn't exist an E_ERROR is issued. The work around for cases

Re: [PHP-DEV] strange autoload behavior

2008-07-10 Thread Gergely Hodicska
Hi Dan, The error was clear: the file containing the class foo was not found. But before I made my post, I did run your test, just to make sure. It worked fine[1] -- because my include_path is set to look at the current directory first. If you used my sample correctly you should get the same

[PHP-DEV] Re: [PHP-DOC] Re: [PHP-DEV] strange autoload behavior

2008-07-10 Thread Lars Strojny
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;

Re: [PHP-DEV] strange autoload behavior

2008-07-10 Thread Jochem Maas
Derick Rethans schreef: On Thu, 10 Jul 2008, Gergely Hodicska wrote: exceptions thrown during autoload are ignored. And one more thing, this is in the manual: "Note: Exceptions thrown in __autoload function cannot be caught in the catch block and results in a fatal error." I think your explan

Re: [PHP-DEV] strange autoload behavior

2008-07-10 Thread Daniel Convissor
Hi Gergely: > You totally missed the point. Please try the code first. I didn't write > but I thought that it is obvious that the files are in the same directory. The error was clear: the file containing the class foo was not found. But before I made my post, I did run your test, just to make s

Re: [PHP-DEV] strange autoload behavior

2008-07-10 Thread Derick Rethans
On Thu, 10 Jul 2008, Gergely Hodicska wrote: > > exceptions thrown during autoload are ignored. > > And one more thing, this is in the manual: > "Note: Exceptions thrown in __autoload function cannot be caught in the catch > block and results in a fatal error." > > I think your explanation makes

Re: [PHP-DEV] strange autoload behavior

2008-07-10 Thread Gergely Hodicska
exceptions thrown during autoload are ignored. And one more thing, this is in the manual: "Note: Exceptions thrown in __autoload function cannot be caught in the catch block and results in a fatal error." I think your explanation makes much more clear what happens, maybe it would worth to up

Re: [PHP-DEV] strange autoload behavior

2008-07-10 Thread Gergely Hodicska
YOu'd be surprised sometimes ;-) Anyway, exceptions thrown during autoload are ignored. Autoloading is the last resort for the engine to find a class. If the class can not be loaded (file isn't there, exception, autoloader doesn't load a file), then you get the fatal error. This is correct beha

Re: [PHP-DEV] strange autoload behavior

2008-07-10 Thread Dmitry Stogov
I have "Fatal error: Class 'Foo' not found" which is expected. Thanks. Dmitry. Gergely Hodicska wrote: > Hi! > > > I think I found a bug but before posing it to bugs.php.net I would like > to ask your opinion. I think the it is not a planed behavior that some > errors doesn't "bubble up" from a

Re: [PHP-DEV] strange autoload behavior

2008-07-10 Thread Derick Rethans
On Wed, 9 Jul 2008, Gergely Hodicska wrote: > This is a SKELETON (use case) to present the error! Do you think somebody > write to the internal list with a dummy error? YOu'd be surprised sometimes ;-) Anyway, exceptions thrown during autoload are ignored. Autoloading is the last resort for the

Re: [PHP-DEV] strange autoload behavior

2008-07-09 Thread Gergely Hodicska
Hi Dan, The fact that the class "bar" is not found indicates that your include in the autoload is either totally failing or gathering some other files. Make your life better by specifying the path in the include statement rather than relying on the include_path. You totally missed the point.

Re: [PHP-DEV] strange autoload behavior

2008-07-09 Thread Daniel Convissor
Hi Gergely: > foo.php: > throw new Exception(); > class foo {} > > bar.php: > class bar extends foo {} > > function __autoload($className) > { > include $className.'.php'; > } > function error_handler() > { > throw new Exception(); > } > set_error_handler("error_handler"); > new b