Home  >  Article  >  Backend Development  >  PHP method to get the list of constants, properties, and methods in a class

PHP method to get the list of constants, properties, and methods in a class

巴扎黑
巴扎黑Original
2016-12-07 15:45:232478browse

PHP method to obtain the list of constants, attributes, and methods in a class

Php code

$r = new ReflectionClass($this);  
Zend_Debug::dump($r->getConstants(), "Constants");  
Zend_Debug::dump($r->getProperties(), "Properties");  
Zend_Debug::dump($r->getMethods(), "Methods");

The above is the content of the method of PHP to obtain the list of constants, attributes, and methods in a class. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP string concatenationNext article:PHP string concatenation