Re: [PHP-DEV] parse errors when testing for undefined exceptions

2004-09-01 Thread Derick Rethans
On Thu, 2 Sep 2004, Alan Knowles wrote: > Marcus Boerger wrote: > > >Hello Alan, > > > >juts for the record, you can even __autoload the missing exception class: > > > >php -n -r 'function __autoload($n) { var_dump($n); eval("class $n extends Exception > >{}"); } try { } catch(ExcetpionXYZ $e) {}

Re: [PHP-DEV] parse errors when testing for undefined exceptions

2004-09-01 Thread Alan Knowles
Marcus Boerger wrote: Hello Alan, juts for the record, you can even __autoload the missing exception class: php -n -r 'function __autoload($n) { var_dump($n); eval("class $n extends Exception {}"); } try { } catch(ExcetpionXYZ $e) {};' dont you think this is a really horrible kludge? and besides

Re: [PHP-DEV] parse errors when testing for undefined exceptions

2004-09-01 Thread Marcus Boerger
Hello Alan, juts for the record, you can even __autoload the missing exception class: php -n -r 'function __autoload($n) { var_dump($n); eval("class $n extends Exception {}"); } try { } catch(ExcetpionXYZ $e) {};' and besides what should the compiler do? Guess what that exception you specified

Re: [PHP-DEV] parse errors when testing for undefined exceptions

2004-09-01 Thread Ron Korving
Okay, I agree with you on this one. Very weird behaviour by the way.. I didn't know about this. "Alan Knowles" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > aghh.. - the previous example was crap > > The priciple it was try to make was that > > > require_once 'MyExceptio

Re: [PHP-DEV] parse errors when testing for undefined exceptions

2004-09-01 Thread Alan Knowles
aghh.. - the previous example was crap The priciple it was try to make was that require_once 'MyException.php' throw MyException(); then trying to catch MyException leads to a parse error when it's try()'d and not loaded. means we cant lazy load any Exceptions, and save file i

Re: [PHP-DEV] parse errors when testing for undefined exceptions

2004-09-01 Thread Alan Knowles
aghh.. - another crap example: The priciple it was try to make was that require_once 'MyException.php' throw MyException(); then trying to catch MyException leads to a parse error when it's try()'d and not loaded. Regards Alan Alan Knowles wrote: This is a simple example of wh

[PHP-DEV] parse errors when testing for undefined exceptions

2004-09-01 Thread Alan Knowles
This is a simple example of why making a parse error out of undefined Exception types is going to be very problematic. function test($a) { if (!extension_exists('sqlite')) { return; } try { SQLite::query($a); // parse error!!! - if we dont have sqlite, we dont ha