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

 ID:                 53522
 Updated by:         cataphr...@php.net
 Reported by:        klederson at phpburn dot com
 Summary:            ReflectionMethod -> getDocComment Problem ( bad
                     results )
 Status:             Open
 Type:               Bug
 Package:            Reproducible crash
 Operating System:   Mac OS 10.6.4
 PHP Version:        5.3SVN-2010-12-11 (snap)
 Block user comment: N
 Private report:     N

 New Comment:

Are you using any kind of opcode cache?


Previous Comments:
------------------------------------------------------------------------
[2010-12-11 22:18:08] 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.


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



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

Reply via email to