php method_exists 检测类中是否包括函数.
method_exists() 函数的语法如下:bool method_exists(object object,string method_name).
method_exists() 函数的作用是检查类的方法是否存在,如果 method_name 所指的方法在 object 所指的对象类中已定义,则返回 true,否则返回 false,实例代码如下:
class a { public function xx(){ echo 'xx'; } public function yy() { echo 'yy'; } } $obj = new a(); var_dump(method_exists($obj, 'xx')); var_dump(method_exists($obj, 'xx')); var_dump(method_exists($obj, 'xx')); //测试结果都为true class a { public function xx(){ echo 'xx'; } public function yy() { echo 'yy'; } public function yy() { echo 'yy'; } } $obj = new a(); $obj->yy(); $obj->yy();
以上语句报错,今天才发现原来php的对象属性是不区分大小写的.
本文地址:
转载随意,但请附上文章地址:-)

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

Dreamweaver Mac version
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

Notepad++7.3.1
Easy-to-use and free code editor

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.
