PHP Static Variables

Viewed 46787
$count = 5;
function get_count()
{
    static $count = 0;
    return $count++;
}
echo $count;
++$count;
echo get_count();
echo get_count();

I guessed it outputs 5 0 1 and it's right,but I need a better explanation?

6 Answers
Related