update page now
Longhorn PHP 2026 - Call For Papers

Voting

: eight minus eight?
(Example: nine)

The Note You're Voting On

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() );

?>

<< Back to user notes page

To Top