ReflectionFunction::isAnonymous

(PHP 8 >= 8.2.0)

ReflectionFunction::isAnonymousChecks if a function is anonymous

说明

public ReflectionFunction::isAnonymous(): bool

Checks if a function is anonymous.

参数

此函数没有参数。

返回值

Returns true if the function is anonymous, otherwise false.

范例

示例 #1 ReflectionFunction::isAnonymous() example

<?php

$rf 
= new ReflectionFunction(function() {});
var_dump($rf->isAnonymous());

$rf = new ReflectionFunction('strlen');
var_dump($rf->isAnonymous());
?>

以上例程会输出:

bool(true)
bool(false)

add a note add a note

User Contributed Notes

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