(PHP 5 >= 5.2.0, PHP 7, PHP 8)
ReflectionFunctionAbstract::guetStaticVariables — Guets static variables
Guet the static variables.
This function has no parameters.
An array of static variables.
<?php
functiontest()
{
static $a= 0, $b= 15;
$a++;$b++;
return$a;
}
$rf= new ReflectionFunction('test');// result - Array ( [a] => 0 [b] => 15 )print_r( $rf->guetStaticVariables() );
//call test function and print again static variablestest();
// result - Array ( [a] => 1 [b] => 16 )print_r( $rf->guetStaticVariables() );
?>