Re: [PHP-DEV] Exceptions and builtin functions in PHP5

2004-04-09 Thread Andi Gutmans
In any case, it'd be interesting to take a look at the possibility of doing this via user-land error handlers. Obviously E_ERRORS wouldn't be recoverable but other errors might work. I'd be happy to hear about your experiences. Andi At 01:41 PM 4/8/2004 +0200, Ferdinand Beyer wrote: On 8 Apr 20

Re: [PHP-DEV] Exceptions and builtin functions in PHP5

2004-04-09 Thread Tumurbaatar S.
Hi, I simply thought that in case of direct using of predefined Exception class, its $file and $line properties would point to my error handler function. I.e. where Exception object was created. Also its constructor does not take file/line as param-s and these properties are read-only, so I thought

Re: [PHP-DEV] Exceptions and builtin functions in PHP5

2004-04-08 Thread Tumurbaatar S.
> > Perhaps this could be done in userland by throwing an exception in a > user error_handler... did not test it though... > It seems that works! At least for E_WARNING: class MyException extends Exception { function __construct($errno, $errstr, $errfile, $errline) { parent::__construct($errst

Re: [PHP-DEV] Exceptions and builtin functions in PHP5

2004-04-08 Thread Ferdinand Beyer
On 8 Apr 2004 at 12:18, Wez Furlong wrote: > > On 8 Apr 2004 at 13:07, Derick Rethans wrote: > > > NO! > > > > That's all, just 'NO!'? :-P > > "NO!" is a shortcut for "Read the annoyingly long thread about > this subject in the archives, please don't start another annoyingly > long thread about it

Re: [PHP-DEV] Exceptions and builtin functions in PHP5

2004-04-08 Thread Wez Furlong
> On 8 Apr 2004 at 13:07, Derick Rethans wrote: > > NO! > > That's all, just 'NO!'? :-P > > Perhaps this could be done in userland by throwing an exception in a > user error_handler... did not test it though... "NO!" is a shortcut for "Read the annoyingly long thread about this subject in the

Re: [PHP-DEV] Exceptions and builtin functions in PHP5

2004-04-08 Thread Ferdinand Beyer
On 8 Apr 2004 at 13:07, Derick Rethans wrote: > NO! > > Derick That's all, just 'NO!'? :-P Perhaps this could be done in userland by throwing an exception in a user error_handler... did not test it though... -- Ferdinand Beyer <[EMAIL PROTECTED]> -- PHP Internals - PHP Runtime Development

Re: [PHP-DEV] Exceptions and builtin functions in PHP5

2004-04-08 Thread Derick Rethans
On Thu, 8 Apr 2004, Tumurbaatar S. wrote: > Is it not what I'm talking about? This document is outdated in much more things then only this. Forget about it. Derick -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Exceptions and builtin functions in PHP5

2004-04-08 Thread Derick Rethans
On Thu, 8 Apr 2004, Ferdinand Beyer wrote: > On 8 Apr 2004 at 12:45, Derick Rethans wrote: > > > > I want to write: > > > ... > > > $res = some_builtin_func(); // func raises exception on error > > > // so I don't need to write additional lines > > > ... > > > > > > So will PHP5 (or futu

Re: [PHP-DEV] Exceptions and builtin functions in PHP5

2004-04-08 Thread Tumurbaatar S.
"Derick Rethans" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 8 Apr 2004, Tumurbaatar S. wrote: > > > > news:[EMAIL PROTECTED] > > > > > If I understand right, PHP5 has an exception > > > > > handling mechanism but it is only for "manual" using, i.e. > > > > > a programmer

Re: [PHP-DEV] Exceptions and builtin functions in PHP5

2004-04-08 Thread Ferdinand Beyer
On 8 Apr 2004 at 12:45, Derick Rethans wrote: > > I want to write: > > ... > > $res = some_builtin_func(); // func raises exception on error > > // so I don't need to write additional lines > > ... > > > > So will PHP5 (or future versions) work as in my 2nd example? > > No It would be

Re: [PHP-DEV] Exceptions and builtin functions in PHP5

2004-04-08 Thread Derick Rethans
On Thu, 8 Apr 2004, Tumurbaatar S. wrote: > > news:[EMAIL PROTECTED] > > > > If I understand right, PHP5 has an exception > > > > handling mechanism but it is only for "manual" using, i.e. > > > > a programmer can use try/catch but only for own code. > > > > PHP's built-in functions and functions