PHP 列出所有对象的属性和方法的函数 [英] PHP's function to list all objects's properties and methods
本文介绍了PHP 列出所有对象的属性和方法的函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有类似 Python 的 dir()
的函数可以列出 PHP 中所有对象的公共方法和属性?
解决方案
PHP5 包含一个完整的 反射 API 超越了旧的 get_class_methods 和 get_object_vars 都可以.>
Is there a function to list all object's public methods and properties in PHP similar to Python's dir()
?
解决方案
PHP5 includes a complete Reflection API for going beyond what the older get_class_methods and get_object_vars can do.
这篇关于PHP 列出所有对象的属性和方法的函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文