Welcome Guest, Not a member yet? Register   Sign In
PHP boolean value assignment
#1

[eluser]Madmartigan1[/eluser]
I see a lot of people doing this:

Code:
if ($foo === $bar)
{
     $baz = true;
}
else
{
     $baz = false;
}

or...

Code:
$baz = $foo === $bar ? : true : false;

Am I missing something?
Isn't this exactly the same, in every case, as this?
Code:
$baz = $foo === $bar;


Messages In This Thread
PHP boolean value assignment - by El Forum - 12-10-2010, 06:05 PM
PHP boolean value assignment - by El Forum - 12-10-2010, 06:27 PM
PHP boolean value assignment - by El Forum - 12-10-2010, 10:26 PM
PHP boolean value assignment - by El Forum - 12-11-2010, 10:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB