php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34243 ReflectionClass::getDocComment() returns no result
Submitted: 2005-08-25 02:27 UTC Modified: 2005-09-21 11:57 UTC
From: colin at encode dot net dot au Assigned: helly (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.1.0RC1 OS: *
Private report: No CVE-ID: None
 [2005-08-25 02:27 UTC] colin at encode dot net dot au
Description:
------------
The getDocComment() method from the Reflection API (in this case, the ReflectionClass class) returns no result where an if block exists before the documentation comment.

Reproduce code:
---------------
if (!class_exists('AnotherObject'))
{
   require("anotherobject.php");
}

/**
 * Comment to test getDocComment()
 */

class TestObject
{

}

$rclass = new ReflectionClass('TestObject');

echo "Comment: '".$rclass->getDocComment()."'";

Expected result:
----------------
Comment: '/** * Comment to test getDocComment() */'

Actual result:
--------------
Comment: ''

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-25 15:20 UTC] sniper@php.net
Assigned to the maintainer.
 [2005-08-26 21:03 UTC] johannes@php.net
Reverting  
http://cvs.php.net/diff.php/ZendEngine2/zend_language_parser.y?r1=1.109&r2=1.110&ty=u  
seems to fix it - at least after reverting it I couldn't  
create any not-working test case. 
 [2005-09-21 11:57 UTC] helly@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 08:01:28 2024 UTC