2008/4/8 Németh Zoltán <[EMAIL PROTECTED]>: > > The humble tilde (~). I came across it the other day in some PHP code > > [code]~E_ERROR[/code] > > > > I'm curious, can't find any documentation on it. In math it refers to > > propostional logic, is it the same thing in PHP ? > > ~ $a Not Bits that are set in $a are not set, and vice versa. > > http://hu.php.net/manual/en/language.operators.bitwise.php > > greets, > Zoltán Németh
You are right, of course, but it is a good question of how one who is totally unfamiliar with bitwise syntax in any language might ever find that. For people learning the language, it's not like they can type a tilde character into the documenation search and get results. Same for the other operators. I suppose if one thinks to search for the word 'operators', one would get there eventually. I remember how thrown I was years ago when I first tried ^ in PHP, having first learned good ol' MS-DOS BASICA years ago, and thinking that I was raising x to the power of y. :-) Andrew PS - For kicks, I just searched for the word 'tilde' and it returned the delete() function. :-O