FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Setting variable to false in a WHILE loop
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Setting variable to false in a WHILE loop [message #175458 is a reply to message #175453] Wed, 28 September 2011 19:49 Go to previous messageGo to previous message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma:
Senior Member
In article
<9281403.1198.1317234500379.JavaMail.geo-discussion-forums@yqma37>,
tamouse <tamouse(dot)lists(at)gmail(dot)com> wrote:

> On Saturday, September 24, 2011 8:14:46 AM UTC-5, Jerry Stuckle wrote:
>> Why complicate things? Why not just use
>>
>> if ($text !== false)
>
> That works, but might be a little opaque. I'd use:
>
> if (!empty($text))
>
> As it's a little more clear to the reader/maintainer.
>
> Also, with the === & !== idiom, isn't it better reverse the operands, thus:
>
> if (FALSE !== $text)

This business of doing:

if (27===$myvar) ...

is the dopiest thing I ever heard of. 27 is equal to 27, end of. People
should really learn that the computer serves *them*, not the other way
around.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Contact Form
Next Topic: OCI.DLL and libcs.dll?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 15:29:33 GMT 2024

Total time taken to generate the page: 0.05112 seconds