Yup :)
-- 
Phil Sturgeon

On March 12, 2014 at 12:27:23 PM, Neil Masters (notifications@github.com) wrote:

In pages/The-Basics.md:

> @@ -304,6 +304,25 @@ vs.
>   
>  $a = 5;
>  return ($a == 5) ? 'yay' : 'nope';    // this example will return 'yay'
> +
> +{% endhighlight %}
> +
> +It should be noted that you do not need to use a ternary operator for returning a boolean value. An example of this would be.
> +
> +{% highlight php %}
> +<?php
> +$a = 3;
> +return ($a == 3) ? true : false; // Will return true or false if $a == 3
> +
> +vs
> +
> +$a = 3;
> +return $a == 3; // Will return true or false if $a == 3
Should we provide some examples of where to use bracketing for readability? I.e. $a == 3 is fine but what about $a == 3 && $b == 4 && $c == 5 or possibly more confusion a mix of all possibilities $a == 3 && $b === 4 || $c !== 5

—
Reply to this email directly or view it on GitHub.