Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_execute.c
| From: | Ilia Alshanetsky | Date: | Mon, 26 Jan 2004 14:13:59 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_execute.c | ||
| References: | 1 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-2270@lists.php.net to get a copy of this message | ||
On January 26, 2004 07:57 am, Andi Gutmans wrote:
> What happened before? Did it just silently continue or did it fail later
> on? If the filename is available don't you want to print it in the error
> message?
Previously unlike with other fatal errors that would stop execution a parse
error would be printed and the 'main' script would continue executing. In my
opinion this is wrong for several reasons. First of all when any other fatal
error is encountered inside an include PHP stops execution, same applies if
the included/required file cannot be found. Additionally it results in an
undefied behaviour with strange errors that may appear at later point because
certain functionality is not avaliable due to the failed include. This is
especially import for require statment, where you cannot see if it had
actually worked successfuly or not by putting it inside an if() statment.
Ilia
>
> At 11:54 PM 1/25/2004 +0000, Ilia Alshanetsky wrote:
> >iliaa Sun Jan 25 18:54:12 2004 EDT
> >
> > Modified files:
> > /ZendEngine2 zend_execute.c
> > Log:
> > Fixed bug #26814 (On parse error include included file, terminate
> > execution script).
> >
> >
>
> >>http://cvs.php.net/diff.php/ZendEngine2/zend_execute.c?r1=1.589&r2=1.590&t
> >y=u Index: ZendEngine2/zend_execute.c
> >diff -u ZendEngine2/zend_execute.c:1.589 ZendEngine2/zend_execute.c:1.590
> >--- ZendEngine2/zend_execute.c:1.589 Sun Jan 25 08:32:02 2004
> >+++ ZendEngine2/zend_execute.c Sun Jan 25 18:54:12 2004
> >@@ -17,7 +17,7 @@
> >
> > +----------------------------------------------------------------------+
> > */
> >
> >-/* $Id: zend_execute.c,v 1.589 2004/01/25 13:32:02 helly Exp $ */
> >+/* $Id: zend_execute.c,v 1.590 2004/01/25 23:54:12 iliaa Exp $ */
> >
> > #define ZEND_INTENSIVE_DEBUGGING 0
> >
> >@@ -3386,6 +3386,9 @@
> > case ZEND_INCLUDE:
> > case ZEND_REQUIRE:
> > new_op_array =
> > compile_filename(EX(opline)->op2.u.constant.value.lval, inc_filename
> > TSRMLS_CC);
> >+ if (!new_op_array) {
> >+ zend_error(E_ERROR, "Parse error inside
> >included file.");
> >+ }
> > break;
> > case ZEND_EVAL: {
> > char *eval_desc =
> > zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
> >
> >--
> >Zend Engine CVS Mailing List (http://cvs.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php