Re: Re: [Zend Engine 2] Re: [PHP-DEV] Re: [Zend Engine 2] Errors and exceptions?
| From: | Roman Neuhauser | Date: | Sun, 24 Nov 2002 14:49:20 +0000 |
| Subject: | Re: Re: [Zend Engine 2] Re: [PHP-DEV] Re: [Zend Engine 2] Errors and exceptions? | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-91499@lists.php.net to get a copy of this message | ||
# sascha@schumann.cx / 2002-11-24 15:39:23 +0100:
> On Sun, 24 Nov 2002, Roman Neuhauser wrote:
> > # ssb@fast.no / 2002-11-12 13:08:33 +0100:
> > > On Tue, 2002-11-12 at 07:54, Derick Rethans wrote:
> > > > And that's why I would be -1 on the first one. However, the whole
> > > > error reporting is a pretty mess, with some extensions implementing
> > > > other 'philosiphies' then others. Getting this all nice and clean is
> > > > another point we should address in PHP 5 (just like Stig mentioned).
> > >
> > > I did not mention that here, but I would like to go through the PHP
> > > source and introduce Unix-style (EPERM etc.) error codes in all calls
> > > to php_error(). But that's not a topic for this mailing list.
> >
> > "Call to nonexistent function" -> ENOTIMPL? :)
>
> Nope, ENOSYS would be appropiate for that.
>
> #define ENOSYS 38 /* Function not implemented */
Sorry, my mistake. Anyway, I *really* like the idea.
I guess it could speed some stuff up. Consider:
do {
if (!file_exists($file)) { $code = ENOENT; break; }
if (!is_readable($file)) { $code = EACCES; break; }
...
}
switch ($code = fopen($file, 'r')) {
case ENOENT:
...
case EACCES:
...
}
--
If you cc me or remove the list(s) completely I'll most likely ignore
your message. see http://www.eyrie.org./~eagle/faqs/questions.html