ReflectionFunctionAbstract::getStaticVariables

(PHP 5 >= 5.2.0, PHP 7)

ReflectionFunctionAbstract::getStaticVariablesGets static variables

Opis

public ReflectionFunctionAbstract::getStaticVariables ( void ) : array

Get the static variables.

Ostrzeżenie

Ta funkcja jest obecnie nieudokumentowana, dostępna jest jedynie lista jej argumentów.

Parametry

Ta funkcja nie posiada parametrów.

Zwracane wartości

An array of static variables.

Zobacz też:

add a note add a note

User Contributed Notes 1 note

up
4
Martiros Aghajanyan
9 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() );

?>
To Top