Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0a1

Bug #7554 Call to undefined method ReflectionClass::hasMethod()
Submitted: 2006-05-04 03:07 UTC
From: gnarea at gmail dot com Assigned: cellog
Status: Closed Package: PhpDocumentor (version 1.3.0RC6)
PHP Version: 5.0.4 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2006-05-04 03:07 UTC] gnarea at gmail dot com (Gustavo Narea)
Description: ------------ When I run phpdocumentor I get this fatal error: Fatal error: Call to undefined method ReflectionClass::hasMethod() in /usr/local/php5/lib/php/PhpDocumentor/phpDocumentor/ParserElements.inc on line 1844 It's because method hasMethod() is available since PHP5.1, but I use v5.0.4. By the way, I also get an E_NOTICE, but it has nothing to do with the previous problem, IMO. Anyway, this is the E_NOTICE: Notice: Trying to get property of non-object in /usr/local/php5/lib/php/PhpDocumentor/phpDocumentor/Converter.inc on line 2622 Call Stack: 0.0194 1. {main}() /usr/local/php5/bin/phpdoc:0 0.0606 2. include() /usr/local/php5/bin/phpdoc:37 0.4722 3. phpDocumentor_setup->createDocs() /usr/local/php5/lib/php/PhpDocumentor/phpDocumentor/phpdoc.inc:61 24.3929 4. phpDocumentor_IntermediateParser->Output() /usr/local/php5/lib/php/PhpDocumentor/phpDocumentor/Setup.inc.php:671 27.5198 5. phpDocumentor_IntermediateParser->Convert() /usr/local/php5/lib/php/PhpDocumentor/phpDocumentor/IntermediateParser.inc:1796 27.5201 6. Converter->walk() /usr/local/php5/lib/php/PhpDocumentor/phpDocumentor/IntermediateParser.inc:1587 27.5204 7. Converter->_createPkgElements() /usr/local/php5/lib/php/PhpDocumentor/phpDocumentor/Converter.inc:1689 27.8058 8. Converter->addElement() /usr/local/php5/lib/php/PhpDocumentor/phpDocumentor/Converter.inc:1456 27.8066 9. Converter->addTodoLink() /usr/local/php5/lib/php/PhpDocumentor/phpDocumentor/Converter.inc:2662 Expected result: ---------------- A workaround for PHP5<5.1, please. Actual result: -------------- A call to a method defined in PHP5.1, which causes an E_ERROR in PHP5<=5.1.

Comments

 [2006-05-18 01:34 UTC] cellog (Greg Beaver)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. removed support for this feature in PHP 5.0.x, there is no way to simulate hasMethod(). The only option is to use getMethod() with a try{} catch{} block, which is not php4-compatible, and most definitely not worth the effort. PHP 5.1.x is perfectly compatible with PHP 5.0.x except it doesn't crash all the time.