Bug #71767 [Opn->Csd]: ReflectionMethod::getDocComment returns the wrong comment
| From: | nikic@php.net | Date: | Fri, 11 Mar 2016 21:30:59 +0000 |
| Subject: | Bug #71767 [Opn->Csd]: ReflectionMethod::getDocComment returns the wrong comment | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-199765@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71767&edit=1
ID: 71767
Updated by: nikic@php.net
Reported by: bashofmann at gmail dot com
Summary: ReflectionMethod::getDocComment returns the wrong
comment
-Status: Open
+Status: Closed
Type: Bug
Package: Reflection related
Operating System: Ubuntu 14.04
PHP Version: 7.0.4
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of g.sokolik@delivery-club.ru
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ccc5150f15c747fe5e9b5a17fcb135e7989d0181
Log: Fix bug #71767
Previous Comments:
------------------------------------------------------------------------
[2016-03-10 12:52:02] bashofmann at gmail dot com
Description:
------------
ReflectionMethod::getDocComment returns the wrong comment when one of method's arguments also
have a comment.
This worked correctly in PHP5.x
Real world use-case for this would be for example having /** @noinspect */ annotations at the
argument for static analysis tools.
See also https://3v4l.org/tR6i5
Test script:
---------------
<?php
class Foo {
/**
* Correct docblock
*/
public function bar(
/** wrong dockblock */
$arg
) {
}
}
$reflection = new ReflectionClass(Foo::class);
echo $reflection->getMethod('bar')->getDocComment();
Expected result:
----------------
/**
* Correct docblock
*/
Actual result:
--------------
/** wrong dockblock */
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71767&edit=1