4

How can I set custom error levels with Zend Framework - say, I want to disable E_NOTICE.

Thanks.

pMan
  • 8,808
  • 11
  • 32
  • 35

3 Answers3

9

If you are using Zend_Application put the following line into your application.ini

phpsettings.error_reporting = E_ALL & ~E_NOTICE

You can also use error_reporting() in your bootstrap like so:

error_reporting(E_ALL & ~E_NOTICE);

The error reporting levels a documented in the PHP manual.

Benjamin Cremer
  • 4,842
  • 1
  • 24
  • 30
2

In application.ini, this works:

phpSettings.error_reporting = E_ALL^E_NOTICE

This won't work:

phpSettings.error_reporting = "E_ALL^E_NOTICE"
Garrett Hyde
  • 5,409
  • 8
  • 49
  • 55
kuko
  • 21
  • 1
0

ZF 1.11, application.ini.

This works:

phpSettings.error_reporting = E_ALL ^ E_NOTICE

This won't work:

phpSettings.error_reporting = E_ALL^E_NOTICE
phpSettings.error_reporting = "E_ALL^E_NOTICE"
topolm
  • 11
  • 2