CakeFest 2024: The Official CakePHP Conference

ReflectionClass::isUserDefined

(PHP 5, PHP 7, PHP 8)

ReflectionClass::isUserDefined检查是否由用户定义的

说明

public ReflectionClass::isUserDefined(): bool

检查一个类是否由用户定义,和内置相对。

参数

此函数没有参数。

返回值

成功时返回 true, 或者在失败时返回 false

参见

add a note

User Contributed Notes 1 note

up
2
dhairya lakhera
8 years ago
$internalclass = new ReflectionClass('ReflectionClass');

class Apple {}
$userclass = new ReflectionClass('Apple');

var_dump($internalclass->isUserDefined());
var_dump($userclass->isUserDefined());
To Top