phpday 2027 - Call for Papers

ReflectionClass::isUserDefined

(PHP 5, PHP 7, PHP 8)

ReflectionClass::isUserDefined — Checks if user defined

Description

public function ReflectionClass::isUserDefined(): bool

Checks whether the class is user-defined, as opposed to internal.

Parameters

This function has no parameters.

Return Values

Returns true on success or false on failure.

See Also

User Contributed Notes 1 note

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

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

var_dump($internalclass->isUserDefined());
var_dump($userclass->isUserDefined());
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top