The description say "(PHP 5, PHP 7)", but anonimous class is avaliable in php 7.
(PHP 7)
ReflectionClass::isAnonymous — Checks if class is anonymous
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)
The description say "(PHP 5, PHP 7)", but anonimous class is avaliable in php 7.