php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36308 ReflectionProperty::getDocComment() does not reflect extended class commentary
Submitted: 2006-02-07 00:33 UTC Modified: 2006-02-08 01:39 UTC
From: pmjones@php.net Assigned: helly (profile)
Status: Closed Package: Unknown/Other Function
PHP Version: 5.1.2 OS: Irrelevant
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pmjones@php.net
New email:
PHP Version: OS:

 

 [2006-02-07 00:33 UTC] pmjones@php.net
Description:
------------
When using ReflectionProperty::getDocComment() to get the comments for a property in an extended class, it returns the comments for the base class, not the extended one.

Reproduce code:
---------------
<?php
class Base {
    /** Base comment block */
    public $foo = 'bar';
}

class Extended extends Base {
    /** Extended commentary */
    public $foo = 'zim';
}


$reflect = new ReflectionClass('Extended');
$props = $reflect->getProperties();
$docs = $props[0]->getDocComment();
print $docs;
// should output "Extended commentary"
// but is in fact "Base comment block"
?>

Expected result:
----------------
/** Extended commentary */

Actual result:
--------------
/** Base comment block */

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-08 01:39 UTC] iliaa@php.net
This bug has been fixed in CVS.

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


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC