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

Bug #14472 Incorrect line numbers with heredoc
Submitted: 2008-08-08 00:13 UTC
From: indigo Assigned: ashnazg
Status: Closed Package: PhpDocumentor (version 1.4.2)
PHP Version: 5.2.6 OS: Ubuntu Linux (x86)
Roadmaps: 1.4.3    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 30 - 23 = ?

 
 [2008-08-08 00:13 UTC] indigo (Steven Harris)
Description: ------------ When viewing a procedural page, includes/functions (and I presume other things), are off by one line, after a heredoc is encountered in the file. I'm guessing the lines would be off in other pages, but I haven't tested them. PHP's tokenizer appears to put a newline in the T_START_HEREDOC token, so adding that to phpDocumentorTWordParser::$_nl_check seems to fix it. Not sure if something else needs to be changed in another location, or if that's enough.

Comments

 [2009-07-21 21:35 UTC] ashnazg (Chuck Burgess)
-Roadmap Versions: +Roadmap Versions: 1.4.3
 [2009-08-30 11:54 UTC] ashnazg (Chuck Burgess)
-Status: Open +Status: Verified
Confirmed this issue exists in v1.4.2 and current SVN, on PHP 5.2.6 and 5.2.10. Test script: <?php /** * @package bug-14472 * @filesource */ /** * function #1 */ function func1() { return 'func1'; } /** * a heredoc * @var string */ $heredoc = <<<ENDOFHEREDOC one two three ENDOFHEREDOC; /** * function #2 */ function func2() { return 'func2'; } ?>
 [2009-08-30 11:55 UTC] ashnazg (Chuck Burgess)
-Status: Verified +Status: Assigned -Assigned To: +Assigned To: ashnazg
 [2009-08-30 12:11 UTC] ashnazg (Chuck Burgess)
-Status: Assigned +Status: Closed
Adding T_START_HEREDOC to $_nl_check does indeed make my test file work. Thanks for the observation, Steven. Fix committed to SVN.