Running the command:
$a = eval('return function foo(){};');
gives the response:
{"r":""}
{"r":"syntax error, unexpected 'foo' (T_STRING), expecting '('"}
which of course is not valid JSON.
This is probably because the syntax error in this eval is ignoredm and the outer eval still returns.
Running the command:
$a = eval('return function foo(){};');
gives the response:
{"r":""}
{"r":"syntax error, unexpected 'foo' (T_STRING), expecting '('"}
which of course is not valid JSON.
This is probably because the syntax error in this eval is ignoredm and the outer eval still returns.