Source for file staticvar.php

Documentation is available at staticvar.php


1 <?php
2 /**
3 * @package Examples
4 * @author Derick Rethans <derick@php.net>
5 */
6
7 /**
8 * Example for static variable in a function
9 * @staticvar integer $count Count the number of times this function was called.
10 */
11 function foo() {
12 static $count;
13
14 $count++;
15 echo $count. "\n";
16 }
17
18 foo();
19 foo();
20 foo():
21 ?>

Documentation generated on Tue, 18 Nov 2003 18:06:12 +0100 by phpDocumentor 1.2.2