Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.2.2

Bug #13998 Parser tries to parse pass '__halt_compiler()' directive
Submitted: 2008-05-28 01:02 UTC
From: jldupont Assigned:
Status: Open Package: PHP_Parser (version 0.2.1)
PHP Version: 5.2.4 OS: Windows
Roadmaps: (Not assigned)    
Subscription  


 [2008-05-28 01:02 UTC] jldupont (Jean-Lou Dupont)
Description: ------------ The parser tries to parse pass a '__halt_compiler()' directive which generates an exception when the content isn't PHP code. Test script: --------------- <?php require 'PHP/Parser.php'; $content = file_get_contents( __FILE__ ); $result = PHP_Parser::parse( $content ); __halt_compiler(); <?xml version="1.0" encoding="utf-8"?> Actual result: -------------- Syntax Error on line 51: token '<' while parsing rule:End of Input top_statement_list T_HALT_COMPILER LPAREN RPAREN SEMI Fatal error: Uncaught exception 'Exception' with message 'Unexpected LESSTHAN(<), expected one of: T_INCLUDE,T_INCLUDE_ONCE,T_EVAL,T_REQUIRE,T_REQUIRE_ONCE,...' in C:\xampp\php\PEAR\PHP\Parser\Core.php:7102 Stack trace: #0 C:\xampp\php\PEAR\PHP\Parser\Core.php(7204): PHP_Parser_Core->yy_syntax_error(34, '<') #1 C:\xampp\php\PEAR\PHP\Parser.php(251): PHP_Parser_Core->doParse(34, '<', Object(PHP_Parser_Tokenizer)) #2 C:\Documents and Settings\Jean-Lou Dupont\My Documents\workspace_e\php-aop\trunk\tests\PHP_Parser\php_parser.php(7): PHP_Parser::parse('<?php??/*?? * @...') #3 {main} thrown in C:\xampp\php\PEAR\PHP\Parser\Core.php on line 7102

Comments