Re: E_RECOVERABLE_ERROR - 5.1.6 to 5.2.0
| From: | Roman Neuhauser | Date: | Thu, 04 Jan 2007 11:02:07 +0000 |
| Subject: | Re: E_RECOVERABLE_ERROR - 5.1.6 to 5.2.0 | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-246511@lists.php.net to get a copy of this message | ||
# neuhauser@sigpipe.cz / 2007-01-04 10:54:58 +0000:
> # greg@chiaraquartet.net / 2007-01-03 15:18:59 -0600:
> > Roman Neuhauser wrote:
> > > # jochem@iamjochem.com / 2007-01-02 21:23:02 +0100:
> > >> there is no mention of try/catch - it seems that the rather unfortunate word
> > >> 'catchable' was used to describe the act of setting up a user defined
> > >> error handler
> > >> (see:
> > >> http://php.net/manual/en/function.set-error-handler.php) to handle
> > >> errors
> > >> that are triggered by the php core. [errors != exceptions]
> > >
> > > Unfortunately. Consider this:
> > >
> > > function f($any)
> > > {
> > > printf("%s\n", $any);
> > > }
> > >
> > > Innocent enough? It's an E_RECOVERABLE_ERROR if $any is an object
> > > without __toString().
> >
> > It's also an example of a former C coder's understanding of how to do
> > things in PHP. Not only is this extremely inefficient (a function call
> > is significant overhead in PHP) it is doubly inefficient through the
> > unnecessary use of printf(). printf() is best used when you are
> > modifying the display of the output, the %s modifier by itself is
> > pointless in PHP.
>
> This is utter crap.
Clarification: the last sentence is true as far as the contrived example
above. The rest of the message (suggestions that structuring code is
bad) and where it leads is without a base.
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991