Checks if a function is anonymous

# ReflectionFunction::isAnonymous

(PHP 8 >= 8.2.0)

ReflectionFunction::isAnonymous — Checks if a function is anonymous

### 说明

public function 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)

### 参见

- Anonymous functions

`↑` and `↓` to navigate • `Enter` to select • `Esc` to close • `/` to open