How EMBARRASSING!

I just found some code I wrote…

$result = ($a == $b) ? true : false;

Or, in non-ternary notation:

if ($a == $b)
result = true;
else
result = false;

Or, in english … evaluate $a == $b and if the result is true, return true, otherwise return false.

I should have just written: $result = $a == $b.

*embarrassed*

1 Comment

Other Links to this Post

RSS feed for comments on this post. TrackBack URI

Leave a comment

WordPress Themes