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

index 912845999130006a60c9309e6bc0c5f5def63be0..be189bf6a02d08c1c72277e4878395c6600aec34 100644 (file)
@@ -165,7 +165,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; }
 ;