PHP never raises any such error: You should be suspicious that a third party has interfered with the installation, possibly installed some kind of "security" focused extension that changes the behaviour of PHP.
All such extensions are not sanctioned by the PHP project, and are terrible.
Despite what the manual says about eval, there is no technical difference between including a file, and evaling some code.
The only difference in the real world is that eval'd code may contain user input: The sanitization and filtering of user input is a problem for PHP applications that do not use eval.
Note: you are missing a return from the evaluated expression