eval function syntax error, unexpected end of file

This forum covers all minor versions of PHP 7
Post Reply
User avatar
Administrator
Site Admin
Posts: 1725
Joined: Thu Mar 22, 2018 10:19 am

eval function syntax error, unexpected end of file

Post by Administrator » Mon Apr 23, 2018 9:08 am

Due to the fact that the eval() function treats a string as a php statement you should always end each statement with a semi colon like you would normally do it php. If you dont you will get an exception from the compiler.

The eval() function is best avoided if possible take a look at call_user_func()

http://php.net/manual/en/function.call-user-func.php

Just Remember
evil eval

Post Reply