ReflectionFunction::isAnonymous

Checks if a function is anonymous

Description

public bool ReflectionFunction::isAnonymous()

Checks if a function is anonymous.

Parameters

This function has no parameters.

Return Values

Returns true if the function is anonymous, otherwise false.

Examples

Example #1 ReflectionFunction::isAnonymous example

<?php

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

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

The above example will output:

bool(true)
bool(false)