GoLang ReflectionClass::isAnonymous

request it (304)
GoLang replacement for PHP's ReflectionClass::isAnonymous [edit | history]



Do you know a GoLang replacement for PHP's ReflectionClass::isAnonymous? Write it!

PHP ReflectionClass::isAnonymous

PHP original manual for ReflectionClass::isAnonymous [ show | php.net ]

ReflectionClass::isAnonymous

(PHP 7)

ReflectionClass::isAnonymousChecks if class is anonymous

Description

public bool ReflectionClass::isAnonymous ( void )

Checks if a class is an anonymous class.

Parameters

This function has no parameters.

Return Values

Returns TRUE on success or FALSE on failure.

Examples

Example #1 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