ReflectionFunction::isAnonymous

(PHP 8 >= 8.2.0)

ReflectionFunction::isAnonymousChecks if a function is anonymous

Descripción

public ReflectionFunction::isAnonymous(): bool

Checks if a function is anonymous.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

Returns true if the function is anonymous, otherwise false.

Ejemplos

Ejemplo #1 ReflectionFunction::isAnonymous() example

<?php

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

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

El resultado del ejemplo sería:

bool(true)
bool(false)

Ver también

add a note add a note

User Contributed Notes

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