From: Operating system: PHP version: 5.3SVN-2010-04-27 (SVN) Package: Scripting Engine problem Bug Type: Feature/Change Request Bug description:Valid phpdoc comments are treated as T_COMMENT (and not T_DOC_COMMENT)
Description: ------------ phpdoc templates are labeled as T_COMMENT tokens, and not T_DOC_COMMENT. The reason for this is that the language scanner requires a whitespace char following /** for phpdoc comments. phpdoc templates use the following syntax: Start a template: /*...@+ * */ End a template: /*...@-*/ These do not have a whitespace following /** so it is treated as a regular multiline comment. Docs about phpdoc templates is available at http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.docblocktemplate My patch includes a change in the language scanner to include these types of comments and a changed test in the tokenizer extension that tests for these comments as well. The patch is made against the 5.3 branch. This is the same issue that is mentioned in bug #26948 but the problem is not in the tokenizer extension, but the language scanner. Test script: --------------- <?php $source = '<?php /*...@+ * Start a template */ /*...@-*/ /*...@- */'; foreach (token_get_all($source) as $token) { print(token_name($token[0]) . PHP_EOL); } Expected result: ---------------- T_OPEN_TAG T_DOC_COMMENT T_WHITESPACE T_DOC_COMMENT T_WHITESPACE T_COMMENT Actual result: -------------- T_OPEN_TAG T_COMMENT T_WHITESPACE T_COMMENT T_WHITESPACE T_COMMENT -- Edit bug report at http://bugs.php.net/bug.php?id=51674&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51674&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51674&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51674&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=51674&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51674&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51674&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51674&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51674&r=needscript Try newer version: http://bugs.php.net/fix.php?id=51674&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51674&r=support Expected behavior: http://bugs.php.net/fix.php?id=51674&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51674&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51674&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51674&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51674&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=51674&r=dst IIS Stability: http://bugs.php.net/fix.php?id=51674&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51674&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51674&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51674&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51674&r=mysqlcfg
