PHP | ReflectionClass isUserDefined() Function
The ReflectionClass::isUserDefined() function is an inbuilt function in PHP which is used to check if any user-defined class is available or not.
Syntax:
bool ReflectionClass::isUserDefined()
Parameters: This function does not accept any parameter.
Return Value: This function returns TRUE if the user-defined class is available, otherwise FALSE.
Below programs illustrate the ReflectionClass::isUserDefined() function in PHP:
Program 1:
php
<?php
Class Company {
public function GeeksforGeeks() {
}
}
$obj = new ReflectionClass( 'Company' );
$A = $obj ->isUserDefined();
var_dump( $A );
?>
|
Output:
bool(true)
Program 2:
php
<?php
$obj = new ReflectionClass( 'ReflectionClass' );
$A = $obj ->isUserDefined();
var_dump( $A );
?>
|
Output:
bool(false)
Reference: https://www.php.net/manual/en/reflectionclass.isuserdefined.php
Last Updated :
19 Feb, 2021
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...