Statement on glibc/iconv Vulnerability

ReflectionFunctionAbstract::getClosureUsedVariables

(PHP 8 >= 8.1.0)

ReflectionFunctionAbstract::getClosureUsedVariablesReturns an array of the used variables in the Closure

Beschreibung

public ReflectionFunctionAbstract::getClosureUsedVariables(): array

Returns an Array of the used variables in the Closure.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

Returns an Array of the used variables in the Closure.

Beispiele

Beispiel #1 ReflectionFunctionAbstract::getClosureUsedVariables() example

<?php

$one
= 1;
$two = 2;

$function = function() use ($one, $two) {
static
$three = 3;
};

$reflector = new ReflectionFunction($function);

var_dump($reflector->getClosureUsedVariables());
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

array(2) {
  ["one"]=>
  int(1)
  ["two"]=>
  int(2)
}

Siehe auch

add a note

User Contributed Notes

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