(PHP 7)
Checks if class is anonymous
public bool ReflectionClass::isAnonymous ( void )
Checks if a class is an anonymous class.
Returns:
Returns TRUE
on success or FALSE
on failure.
Examples:
ReflectionClass::isAnonymous() example
<?php class TestClass {} $anonClass = new class {}; $normalClass = new ReflectionClass('TestClass'); $anonClass = new ReflectionClass($anonClass); var_dump($normalClass->isAnonymous()); var_dump($anonClass->isAnonymous()); ?>
The above example will output:
bool(false) bool(true)
See also:
Please login to continue.