ReflectionClass::isAnonymous

(PHP 7)

ReflectionClass::isAnonymousChecks if class is anonymous

설명

public bool ReflectionClass::isAnonymous ( void )

Checks if a class is an anonymous class.

인수

이 함수는 인수가 없습니다.

반환값

성공 시 TRUE를, 실패 시 FALSE를 반환합니다.

예제

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());

?>

위 예제의 출력:

bool(false)
bool(true)

참고

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top