Hi all
since PHP 4.3.5 interpreter stops on parse error. With our current code this leads to empty page when user makes such error in configuration. This is pretty confusing, see bugreport [1].
Possible solutions, that come to my mind:
- do not reset error reporting - user will get directly error message
- eval config file content, parse errors inside eval are not thet fatal, so we can hide errors in that time and handle error simmilar way how we did it before
1. https://sourceforge.net/tracker/?func=detail&atid=377408&aid=1223319...
Michal Čihař a écrit :
Hi all
since PHP 4.3.5 interpreter stops on parse error. With our current code this leads to empty page when user makes such error in configuration. This is pretty confusing, see bugreport [1].
Possible solutions, that come to my mind:
do not reset error reporting - user will get directly error message
eval config file content, parse errors inside eval are not thet fatal, so we
can hide errors in that time and handle error simmilar way how we did it before
https://sourceforge.net/tracker/?func=detail&atid=377408&aid=1223319...
Michal,
I would prefer your second solution eval() of the file contents, which returns FALSE in case of parse error.
Marc
On Monday 11 July 2005 18:52, Marc Delisle wrote:
I would prefer your second solution eval() of the file contents, which returns FALSE in case of parse error.
Are you sure? AFAIK eval does not return anything unless there is return statement in evaled code.
Michal Čihař a écrit :
On Monday 11 July 2005 18:52, Marc Delisle wrote:
I would prefer your second solution eval() of the file contents, which returns FALSE in case of parse error.
Are you sure? AFAIK eval does not return anything unless there is return statement in evaled code.
From http://ca.php.net/manual/en/function.eval.php: "In case of a parse error in the evaluated code, eval() returns FALSE."
Marc
On Monday 11 July 2005 20:07, Marc Delisle wrote:
From http://ca.php.net/manual/en/function.eval.php: "In case of a parse error in the evaluated code, eval() returns FALSE."
Ah, you're right, but you have to test it as === FALSE as normal eval returns NULL which is also not true.
Michal C(ihar( a écrit:
On Monday 11 July 2005 20:07, Marc Delisle wrote:
From http://ca.php.net/manual/en/function.eval.php: "In case of a parse error in the evaluated code, eval() returns FALSE."
Ah, you're right, but you have to test it as === FALSE as normal eval returns NULL which is also not true.
Yes, good point.
Marc