]> granicus.if.org Git - php/commitdiff
MFH: fix #39903 (Notice message when executing __halt_compiler() more than once)
authorAntony Dovgal <tony2001@php.net>
Wed, 20 Dec 2006 16:31:10 +0000 (16:31 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 20 Dec 2006 16:31:10 +0000 (16:31 +0000)
NEWS
Zend/zend_language_parser.y

diff --git a/NEWS b/NEWS
index 7553cdf473778ac8a0b01766ff72e52e7f749fc5..ff7b6a7ace7c98385051cafe3b1e4f3b98409a33 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,8 @@ PHP                                                                        NEWS
 - Fixed the validate email filter so that the letter "v" can also be used in
   the user part of the email address. (Derick)
 
+- Fixed bug #39903 (Notice message when executing __halt_compiler() more than 
+  once). (Tony)
 - Fixed bug #39869 (safe_read does not initialize errno).
   (michiel at boland dot org, Dmitry)
 - Fixed bug #39850 (SplFileObject throws contradictory/wrong error messages 
index 679021013a7f8f317b089b358aec280e188c10c3..b22da7a95f2458a770e1107d1879261c4080aa6c 100644 (file)
@@ -162,7 +162,7 @@ top_statement:
                statement
        |       function_declaration_statement  { zend_do_early_binding(TSRMLS_C); }
        |       class_declaration_statement             { zend_do_early_binding(TSRMLS_C); }
-       |       T_HALT_COMPILER '(' ')' ';'   { REGISTER_MAIN_LONG_CONSTANT("__COMPILER_HALT_OFFSET__", zend_get_scanned_file_offset(TSRMLS_C), CONST_CS); YYACCEPT; }
+       |       T_HALT_COMPILER '(' ')' ';'   { zval c; if (zend_get_constant("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__") - 1, &c TSRMLS_CC)) { zval_dtor(&c); zend_error(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used once per request"); } else { REGISTER_MAIN_LONG_CONSTANT("__COMPILER_HALT_OFFSET__", zend_get_scanned_file_offset(TSRMLS_C), CONST_CS); } YYACCEPT; }
 ;