首页 > 其他 > 详细

function_exists method_exists is_callable 区别和简单实例

时间:2020-07-08 10:25:28      阅读:57      评论:0      收藏:0      [点我收藏+]
function_exists() 判断非类的函数是否存在
method_exists() 判断类中是否存在某个方法
is_callable() 判断一个函数或方案是否可以被调用

function aa(){}
function_exists(‘aa‘);//true

class abc{
public static $a =1;
private function ab(){
}
}
var_dump(is_callable([‘abc‘,‘ab‘]));//false
var_dump(method_exists(‘abc‘,‘ab‘));//true


function_exists method_exists is_callable 区别和简单实例

原文:https://www.cnblogs.com/jinshao/p/13264397.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!