array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'reflectionfunctionabstract.getclosureusedvariables.php', 1 => 'ReflectionFunctionAbstract::getClosureUsedVariables', 2 => 'Returns an array of the used variables in the Closure', ), 'up' => array ( 0 => 'class.reflectionfunctionabstract.php', 1 => 'ReflectionFunctionAbstract', ), 'prev' => array ( 0 => 'reflectionfunctionabstract.getclosurethis.php', 1 => 'ReflectionFunctionAbstract::getClosureThis', ), 'next' => array ( 0 => 'reflectionfunctionabstract.getdoccomment.php', 1 => 'ReflectionFunctionAbstract::getDocComment', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/reflection/reflectionfunctionabstract/getclosureusedvariables.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PHP 8 >= 8.1.0)
ReflectionFunctionAbstract::getClosureUsedVariables — Returns an array of the used variables in the Closure
Bu işlevin bağımsız değişkeni yoktur.
Örnek 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());
?>Yukarıdaki örnek şuna benzer bir çıktı üretir:
array(2) {
["one"]=>
int(1)
["two"]=>
int(2)
}