Re: "My truth comes out" [1]
| From: | Alexander Schrijver | Date: | Thu, 21 Oct 2010 10:54:27 +0000 |
| Subject: | Re: "My truth comes out" [1] | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-308923@lists.php.net to get a copy of this message | ||
On Thu, Oct 21, 2010 at 08:15:40PM +1000, Russell Dias wrote:
> Whats wrong with an if *construct* ? I understand that the ternary
> operator is another way of doing it. Using it in such a small scenario
> is perfectly justifiable. Its ridiculous to use in more complicated
> scenarious because of readability issues.
It depends on what the output is. If it actually is either "TRUE" or "FALSE"
then it would be fine.
>
> Direct string comparison? You suggested yet another function call,
> settype I believe. Please do not make benchmark claims without any
> data.
You use preg_match which loads the PCRE library which obviously is overkill here.