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

Home » Imported messages » comp.lang.php » empty - not empty()
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
empty - not empty() [message #176291] Mon, 19 December 2011 15:09 Go to previous message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma:
Senior Member
searching the manual gives lots of hits, none of which appear
relevant (at least by the title).

I had the following code in a scheduling class:

if ($ptNum == "empty") {
$ptNum = 0;
$status= "e";
}

I pass the string "empty" to the function as a patient number if
we are creating an empty appointment slot.

now, this fails because with a patient number of 0 the if returns
true.

I am aware of the function empty() that would work like that, but
do not understand why the compare fails with the constant, "empty."

I fixed the function by making it a strict compare, but would
like to know why the regular compare is true with the numeric
value of zero.

bill
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: FastCGI + ignore_user_abort
Next Topic: united governments of planet earth
Goto Forum:
  

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

Current Time: Fri Nov 22 11:11:52 GMT 2024

Total time taken to generate the page: 0.05805 seconds