Unexpected $end in eval()'d code
eval
only accepts statements, not expressions. You need to convert your tests with:
if (eval("return $task[0];")) {
You are missing ';' on end of string evaluation. Eval function able to process statements or expressions.
Example:
$value = 7;
eval("\$value+=2;");
echo $value;