php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53522 ReflectionMethod -> getDocComment Problem ( bad results )
Submitted: 2010-12-11 22:18 UTC Modified: 2010-12-11 23:26 UTC
From: klederson at phpburn dot com Assigned:
Status: Not a bug Package: Reflection related
PHP Version: 5.3SVN-2010-12-11 (snap) OS: Mac OS 10.6.4
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: klederson at phpburn dot com
New email:
PHP Version: OS:

 

 [2010-12-11 22:18 UTC] klederson at phpburn dot com
Description:
------------
---
From manual page: http://www.php.net/class.reflectionmethod
---

Hi,

I'm trying to use ReflectionMethod::getDocComment() but i'm getting this little issue, it ONLY brings the comment at first time you load it OR if you change the main called file/class.

In Test Script examples, you can see it will only bring once the comment from myMethod in Test Class.

Even if you run ReflectionTest.php many times ( from browser or shell ) it will bring it only once or again if you change and save Test.php ( or equivalent ) file.

Test script:
---------------
Example (Test.php)
class Test {
	/**
	 * Hi this is a comment
	 */
	public function myMethod() {
		print "Hi";
	}
}

Example (ReflectionTest.php)
require_once('test.php');
$reflectionMethod = new ReflectionMethod('Test', 'myMethod');
echo $reflectionMethod->getDocComment();

Expected result:
----------------
Get Method Comments ( ReflectionMethod::getDocComment() )

Actual result:
--------------
Even if you run ReflectionTest.php many times ( from browser or shell ) it will bring it only once or again if you change and save Test.php ( or equivalent ) file.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-11 23:00 UTC] cataphract@php.net
Are you using any kind of opcode cache?
 [2010-12-11 23:00 UTC] cataphract@php.net
-Status: Open +Status: Feedback
 [2010-12-11 23:02 UTC] cataphract@php.net
Also, so that we're clear: what happens he second, third, etc. time? Is there a crash? If so, can you provide a backtrace? Or does it simply work as if there was no comment?

Thanks.
 [2010-12-11 23:20 UTC] klederson at phpburn dot com
-Status: Feedback +Status: Open
 [2010-12-11 23:20 UTC] klederson at phpburn dot com
Sorry maybe my mistake in Flagging it.

It does not crash, it only dont work, wrong category.

I'm running some testes using 5.3.4 in Mac OS and it seems to be fixed so probably you guys already fixed it.

If something goes wrong again i will let you know.
 [2010-12-11 23:26 UTC] felipe@php.net
-Status: Open +Status: Bogus -Package: Reproducible crash +Package: Reflection related
 [2010-12-11 23:26 UTC] felipe@php.net
.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 09:01:33 2024 UTC