mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-27 04:24:43 +01:00
Recognize halt_compiler() ?> (without ;)
This commit is contained in:
parent
afdfb6bf08
commit
69b298c4b5
@ -117,7 +117,7 @@ class PHPParser_Lexer
|
||||
// ensure that it is followed by ();
|
||||
// this simplifies the situation, by not allowing any comments
|
||||
// in between of the tokens.
|
||||
if (!preg_match('~\s*\(\s*\)\s*;~', $textAfter, $matches)) {
|
||||
if (!preg_match('~\s*\(\s*\)\s*(?:;|\?>)~', $textAfter, $matches)) {
|
||||
throw new PHPParser_Error('__halt_compiler must be followed by "();"');
|
||||
}
|
||||
|
||||
|
@ -87,6 +87,7 @@ class PHPParser_Tests_LexerTest extends PHPUnit_Framework_TestCase
|
||||
return array(
|
||||
array('<?php ... __halt_compiler();Remaining Text', 'Remaining Text'),
|
||||
array('<?php ... __halt_compiler ( ) ;Remaining Text', 'Remaining Text'),
|
||||
array('<?php ... __halt_compiler() ?>Remaining Text', 'Remaining Text'),
|
||||
//array('<?php ... __halt_compiler();' . "\0", "\0"),
|
||||
//array('<?php ... __halt_compiler /* */ ( ) ;Remaining Text', 'Remaining Text'),
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user