Re: Can someone tell me what a tilde means ?
| From: | Andrew Ballard | Date: | Tue, 08 Apr 2008 13:51:04 +0000 |
| Subject: | Re: Can someone tell me what a tilde means ? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-272704@lists.php.net to get a copy of this message | ||
2008/4/8 Németh Zoltán <znemeth@alterationx.hu>:
> > 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