On Tue, 2002-11-12 at 07:54, Derick Rethans wrote: > On 12 Nov 2002, Timm Friebe wrote: > > > On Mon, 2002-11-11 at 23:26, Stig S. Bakken wrote: > > [...] > > > > The problem here is that PHP's E_WARNING does not resemble an exception. > > > > Some of the warnings raised are only of informational intent and do not > > > > indicate the failure of a function. > > [...] > > > Right. What this illustrates is that "PHP errors" as such as way too > > > random and unstructured to be of any other use than showing error > > > messages to developers. > > > > Well, would it be wise then to either: > > * Change informational warnings to E_NOTICE > > (e.g. Notice: Called ... before fetching all rows ...) > > or > > * Introduce E_FAIL and use it for cases when a function fails > > (say, fopen('/doesnotexist', 'r')) > > > > In both cases, people doing string magic with $php_errormsg (if > > ereg("not exist", $php_errormsg)) or having their own error handlers > > consisting of constructs like > > if (E_WARNING == $code) > > would see their code break. > > > > As for the first suggestion, the downside is that a lot of people will > > miss the message(s) since they've disabled E_NOTICEs. > > 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. - Stig -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php