Update The-Basics.md

Updated to conform to rest of document and I believe that I have utilized the correct syntax for then highlighters.
This commit is contained in:
Neil Masters
2014-03-12 16:25:24 +00:00
parent 0b78a32686
commit 84491f7b06

View File

@@ -305,15 +305,21 @@ vs.
$a = 5;
return ($a == 5) ? 'yay' : 'nope'; // this example will return 'yay'
It should be noted to save confusion that you do not need to use a ternary operator for returning a boolean value. An example of this would be.
{% 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
return $a == 3; // Will return true or false if $a == 3
{% endhighlight php %}
This can also be said for all operations(===, !==, !=, == etc).