如何检查方法是否在PHP中是静态的? [英] How to check whether a method is static in PHP?

查看:60
本文介绍了如何检查方法是否在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中是静态的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆