Jump to content


Photo

false


  • Please log in to reply
7 replies to this topic

#1 Tandem

Tandem
  • Members
  • PipPipPip
  • Advanced Member
  • 251 posts

Posted 26 September 2006 - 09:15 PM

if i set a variable to false like this:

$blah = false;

Does that effectively 'empty' the variable? Or does it literraly make it "false"? Or something else?

#2 livepjam

livepjam
  • Members
  • PipPip
  • Member
  • 20 posts

Posted 26 September 2006 - 09:19 PM

I believe it would truly make it a boolean, i.e. false.

#3 newb

newb
  • Members
  • PipPipPip
  • Advanced Member
  • 454 posts

Posted 26 September 2006 - 09:20 PM

whats a boolean

#4 tleisher

tleisher
  • Members
  • PipPipPip
  • Advanced Member
  • 88 posts

Posted 26 September 2006 - 09:22 PM

A boolean is a true/false test, it always returns True or false, nothing more.

#5 livepjam

livepjam
  • Members
  • PipPip
  • Member
  • 20 posts

Posted 26 September 2006 - 09:22 PM

Eh, I'm not sure now...

I tried the following code and it output the text:

<?php

$blah = false;

if (empty($blah))
echo "It is empty";

?>

I guess that would mean the variable is empty.

#6 Tandem

Tandem
  • Members
  • PipPipPip
  • Advanced Member
  • 251 posts

Posted 26 September 2006 - 09:24 PM

I just tried:

$blah = false;

echo "$blah";

and got no output, so yeah i guess it must be empty.

#7 livepjam

livepjam
  • Members
  • PipPip
  • Member
  • 20 posts

Posted 26 September 2006 - 09:26 PM

It is empty, but it still holds the value false.

<?php

$blah = false;

if ($blah == false)
echo "It is empty";

?>

If you do that, it outputs the echo.

#8 Tandem

Tandem
  • Members
  • PipPipPip
  • Advanced Member
  • 251 posts

Posted 26 September 2006 - 09:27 PM

Ok cool, thanks for the replies.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users