# Selectable error messages

- Thread: https://externals.io/message/38341
- Original archive: https://news-web.php.net/php.internals/38341
- Started by Lester Caine on 2008-06-18T07:14:52+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #38341 — Lester Caine — 2008-06-18T07:14:52+00:00

URL: https://externals.io/message/38341#38341

OK - I've got PHP5.3.0-dev up at the moment in order to test the Firebird 
stuff, so display_errors is on. I need it on anyway while testing code.

The 'problem' I am having is that of cause none of the other PHP stuff I'm 
using is currently not compatible with PHP5.3 so generates a lot of deprecated 
warnings in particular.

Current one is phpDocumentor which uses `is_a()` extensively, and has a function 
to replicate it for backwards compatibility.

Short of switching display_errors on and off all the time, how do other people 
handle this irritation? I could repair phpDocumentor in this case and ignore 
BC as I will not be running THAT on older version of PHP, and since a run is 
taking 30 minutes it would be interesting to see if there is any improvement 
to time.

.... bit the bullet - my copy of phpDocumentor has no `is_a()` in it ....

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

---

## #38342 — Pierre Joye — 2008-06-18T07:22:09+00:00

URL: https://externals.io/message/38341#38342 · In reply to: #38341

hi Lester,



> Short of switching display_errors on and off all the time, how do other
> people handle this irritation? I could repair phpDocumentor in this case and
> ignore BC as I will not be running THAT on older version of PHP, and since a
> run is taking 30 minutes it would be interesting to see if there is any
> improvement to time.

Use error_reporting in your php.ini or within your applicaion:
error_reporting(E_ALL ^ E_DEPRECATED);

Cheers,
--
Pierre

http://blog.thepimp.net | http://www.libgd.org

---

## #38347 — Christian Schmidt — 2008-06-18T12:03:41+00:00

URL: https://externals.io/message/38341#38347 · In reply to: #38341

Lester Caine wrote:
> Short of switching display_errors on and off all the time, how do other
> people handle this irritation?

I don't have experiences with E_DEPRECATED, but for `E_STRICT` we use a 
custom error handler to surpress strict errors in external libraries. 
Not all `E_STRICT` errors can be caught in this way, especially not if you 
are using an opcode cache.

Our error handler looks like this, perhaps you can do something similar 
for E_DEPRECATED.:


if (!($errorNumber & `error_reporting()`) ||
     $errorNumber == `E_STRICT` &&
     (strpos($fileName, '/pear/') !== false ||
      strpos($fileName, '/smarty/') !== false ||
      preg_match('/^Non-static method (DB|HTTP|Mail_RFC822|PEAR)::/',
                 $message))) {

     if ($errorNumber & (E_ERROR | `E_RECOVERABLE_ERROR` | E_USER_ERROR)) {
         exit;
     }
     return;
}
// Show error message etc.


Christian

---

## #38427 — Marcus Boerger — 2008-06-19T18:57:18+00:00

URL: https://externals.io/message/38341#38427 · In reply to: #38341

Hello Lester,

Wednesday, June 18, 2008, 9:14:52 AM, you wrote:

> OK - I've got PHP5.3.0-dev up at the moment in order to test the Firebird 
> stuff, so display_errors is on. I need it on anyway while testing code.

> The 'problem' I am having is that of cause none of the other PHP stuff I'm 
> using is currently not compatible with PHP5.3 so generates a lot of deprecated
> warnings in particular.

> Current one is phpDocumentor which uses `is_a()` extensively, and has a function
> to replicate it for backwards compatibility.

Hey guys, I thought we undeprecated `is_a()`?

there is no need whatsoever to deprecate it.

Best regards,
 Marcus

---

## #38430 — Pierre Joye — 2008-06-19T19:03:15+00:00

URL: https://externals.io/message/38341#38430 · In reply to: #38427

Hi Marcus,


> Hello Lester,
>
> Wednesday, June 18, 2008, 9:14:52 AM, you wrote:
>
> > […]
>
> > […]
>
> > […]
>
> Hey guys, I thought we undeprecated `is_a()`?
>
> there is no need whatsoever to deprecate it.

We did, I would appreciate if you can nicely remove the `E_DEPRECATED` from it :)

Cheers,
-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org
