From 2be210a68755a5318c3c542dd56e1ba5b4c81b78 Mon Sep 17 00:00:00 2001 From: Tom de Bruin Date: Thu, 11 Oct 2012 05:17:06 +0100 Subject: [PATCH] Corrected ternary operator syntax --- pages/The-Basics.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pages/The-Basics.md b/pages/The-Basics.md index 7b2e893..6019458 100644 --- a/pages/The-Basics.md +++ b/pages/The-Basics.md @@ -293,12 +293,17 @@ $b = 10; echo ($a) ? ($a == 5) ? 'yay' : 'nay' : ($b == 10) ? 'excessive' : ':('; // excess nesting, sacrificing readability {% endhighlight %} -Ternary operators also have their limitations and cannot be used to 'return' a value. +To 'return' a value with ternary operators use the correct syntax. {% highlight php %}