本文介绍了如何检查方法是否在PHP中是静态的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要知道该方法的名称以及包含该方法的类的名称是否声明为静态方法. method_exists
为静态方法和非静态方法提供true
.
I need to know whether the method is declared as static given its name and the name of the class containing it. method_exists
provides true
for both static and non-static methods.
推荐答案
使用 ReflectionMethod :: isStatic
这篇关于如何检查方法是否在PHP中是静态的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!