#36308 [Opn->Asn]: ReflectionProperty::getDocComment() does not reflect extended class commentary

From: Date: Tue, 07 Feb 2006 11:28:18 +0000
Subject: #36308 [Opn->Asn]: ReflectionProperty::getDocComment() does not reflect extended class commentary
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-93004@lists.php.net to get a copy of this message
 ID:               36308
 Updated by:       tony2001@php.net
 Reported By:      pmjones@php.net
-Status:           Open
+Status:           Assigned
 Bug Type:         Unknown/Other Function
 Operating System: Irrelevant
 PHP Version:      5.1.2
-Assigned To:      
+Assigned To:      helly


Previous Comments:
------------------------------------------------------------------------

[2006-02-07 00:33:32] 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 */


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=36308&edit=1


Thread (4 messages)

« previous php.bugs (#93004) next »