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
mikebr
Forum Contributor
Posts: 243 Joined: Sat Sep 28, 2002 7:05 am
Post
by mikebr » Wed Mar 04, 2009 9:19 am
Been trying to find out why one might use a tilde '~' before E_NOTICE such as:
Code: Select all
error_reporting(E_ALL & ~E_NOTICE);
@ini_set('display_errors', 1);
Searched around the web and in the manual without any joy, If someone could explain the difference of using a ~ or not please?
Thanks in advance
VladSun
DevNet Master
Posts: 4313 Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria
Post
by VladSun » Wed Mar 04, 2009 10:17 am
There are 10 types of people in this world, those who understand binary and those who don't
semlar
Forum Commoner
Posts: 61 Joined: Fri Feb 20, 2009 10:45 pm
Post
by semlar » Wed Mar 04, 2009 10:18 am
It's a bitwise operator.. means negation. The ampersand is bitwise AND.
Error reporting is measured in bit values, and negating one basically tells it not to report that type of error.
Ah, you beat me to it, I'll leave this here anyway.
mikebr
Forum Contributor
Posts: 243 Joined: Sat Sep 28, 2002 7:05 am
Post
by mikebr » Wed Mar 04, 2009 4:57 pm
Great thanks