PHP Error Reporting

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JakeJ
Forum Regular
Posts: 675
Joined: Thu Dec 10, 2009 6:27 pm

PHP Error Reporting

Post by JakeJ »

I'm having trouble turning error reporting off.

I've set the following in php.ini:
error_reporting = E_ALL & ~E_DEPRECATED
display_errors = off

Also tried ~E_NOTICE but that didn't work either.

Specifically I'm getting deprecated errors:
Deprecated: Assigning the return value of new by reference is deprecated in <path>

The above line of code did not turn it off.

I also tried error_reporting(0); right on the page (actually on both pages involved) and that hasn't worked either.

Bottom line is, I have to get rid of that error! how do I do that? Getting rid of the code that causing the error isn't an option right now.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: PHP Error Reporting

Post by requinix »

You know, all you have to do to resolve that error is remove the & from

Code: Select all

$var =& new Object();
Two seconds.

What if you do the error_reporting(0); just before that one line?
JakeJ
Forum Regular
Posts: 675
Joined: Thu Dec 10, 2009 6:27 pm

Re: PHP Error Reporting

Post by JakeJ »

I removed & and that did trick. I appreciate it!
Post Reply