|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50174 Incorrectly matched docComment
Submitted: 2009-11-14 05:18 UTC Modified: 2009-11-14 19:17 UTC
From: david at grudl dot com Assigned: felipe (profile)
Status: Closed Package: Reflection related
PHP Version: 5.2, 5.3, 6 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: david at grudl dot com
New email:
PHP Version: OS:


 [2009-11-14 05:18 UTC] david at grudl dot com
ReflectionMethod and ReflectionProperty may return invalid phpDocComment. See examples:

Reproduce code:

class TestClass
	/** const comment */
	const C = 0;

	function x() {}

$rm = new ReflectionMethod('TestClass', 'x');
echo $rm->getDocComment();

// OR


class TestClass
	/** const comment */
	const C = 0;

	var $x;

$rp = new ReflectionProperty('TestClass', 'x');
echo $rp->getDocComment();

Expected result:

Actual result:
/** const comment */


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-14 19:17 UTC]
Automatic comment from SVN on behalf of felipe
Log: - Fixed bug #50174 (Incorrectly matched docComment)
 [2009-11-14 19:17 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Sep 27 13:03:36 2021 UTC