PHP 8.6.0 Beta 1 is available for testing

ReflectionFunctionAbstract::getStaticVariables

(PHP 5 >= 5.2.0, PHP 7, PHP 8)

ReflectionFunctionAbstract::getStaticVariablesObtiene las variables estáticas

Descripción

public function ReflectionFunctionAbstract::getStaticVariables(): array

Obtiene las variables estáticas.

Parámetros

Esta función no contiene ningún parámetro.

Valores devueltos

Un array de variables estáticas.

Véase también

Found A Problem?

Learn How To Improve This PageSubmit a Pull RequestReport a Bug
+add a note

User Contributed Notes 1 note

up
5
Martiros Aghajanyan
11 years ago
<?php
function test()
{
 static $a = 0, $b = 15;
 $a++;
 $b++;
 return $a;
}
$rf = new ReflectionFunction('test');
// result - Array ( [a] => 0 [b] => 15 ) 
print_r( $rf->getStaticVariables() );
//call test function and print again static variables
test();
// result - Array ( [a] => 1 [b] => 16 ) 
print_r( $rf->getStaticVariables() );
?>
+add a note

AltStyle によって変換されたページ (->オリジナル) /