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 #175453 is a reply to message #175436] Wed, 28 September 2011 18:28 Go to previous messageGo to previous message
tamouse is currently offline  tamouse
Messages: 5
Registered: September 2011
Karma:
Junior Member
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)

?
[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:31:48 GMT 2024

Total time taken to generate the page: 0.05361 seconds