So there is a problem with this, but i’m blind to it.
Even after reading the documentation twice (PHP Comparison Operators)
isset($items['blog']) ? unset($items['blog']) : NULL;
Parse error: syntax error, unexpected T_UNSET
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A @Bryan points out, no
functioncalls to language constructs within the ternary operator. Since there’s no return value involved at all here though, just do:There’s no need to check if the value is set or not beforehand. If it is not,
unsetsimply won’t do anything.