RE: [PHP] Re: UNLESS Statement Equivalent
| From: | Ford, Mike | Date: | Tue, 12 Mar 2013 13:25:46 +0000 |
| Subject: | RE: [PHP] Re: UNLESS Statement Equivalent | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-320488@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Arno Kuhl [mailto:arno@dotcontent.net]
> Sent: 12 March 2013 13:04
>
> Mike, I presume you're saying the precedence of the Boolean keyword
> operators is lower than the Boolean symbol operators, but if so then
> wouldn't there be less need for the parentheses? I prefer using the
> Boolean
> keyword operators for both the readability and because of the lower
> precedence. Unless I've been wrong all this while and the keyword
> precedence
> is actually higher?
You are absolutely right, of course -- I failed to engage brain before
typing words! Both sets of Boolean operators have lower priority than
the comparison operators, so none of the parentheses are needed in
either of those cases -- it's the assigning operators (and ?:) that
come between the symbolic and keyword Booleans, so that
$a = $b = true&&$c
means something different from
$a = $b=true and $c
Thanks for picking me up on that one!
Cheers!
Mike
--
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,
Portland PD507, City Campus, Leeds Metropolitan University,
Portland Way, LEEDS, LS1 3HE, United Kingdom
E: m.ford@leedsmet.ac.uk T: +44 113 812 4730
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm