From bbae7706dc4d8f679ce511e58747280e81e9943a Mon Sep 17 00:00:00 2001 From: Szymon Nastaly <32243444+SzymonNastaly@users.noreply.github.com> Date: Sun, 5 Jan 2020 16:49:10 +0100 Subject: [PATCH] small addition to 07-conditionals.md When I was working through it, I first didn't get it that it would return the value of the variable if it has one. Maybe something along the lines of my change would be helpful? --- content/07-conditionals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/07-conditionals.md b/content/07-conditionals.md index cc78d19..e102396 100644 --- a/content/07-conditionals.md +++ b/content/07-conditionals.md @@ -79,7 +79,7 @@ $language = 'english'; echo $language == 'spanish' ? "hola\n" : "hello\n"; ``` -Lastly, there is another form of a ternary that checks if a value is set and then returns the value to the right of the two question marks if the value is null. +Lastly, there is another form of a ternary that checks if a value is set and then returns the value to the right of the two question marks if the value is null. Otherwise, if the value is set it returns the content of the variable. ```php echo $IDoNotExist ?? "Variable not set\n"; ```