Unexpected $end in eval()'d code

前端 未结 2 556
抹茶落季
抹茶落季 2020-12-16 15:31

I hate to ask such a specific question, but I\'m getting an error I can\'t figure out. This is in a cron job which runs on the hour. I\'m creating an array of tasks, each of

2条回答
  •  一个人的身影
    2020-12-16 16:31

    eval only accepts statements, not expressions. You need to convert your tests with:

    if (eval("return $task[0];")) {
    

提交回复
热议问题