Location: PHPKode > projects > phc > test/subjects/codegen/reference_to_static.php
<?php
/*
 * Reference to a static variable
 * Example due to hide@address.com
 */

	function &getStatic()
	{
		static $staticVar = 0;
		return $staticVar;
	}

	function f()
	{
		$x =& getStatic();
		var_export($x);
		$x++;
	}

	function g()
	{
		$y =& getStatic();
		var_export($y);
		$y++;
	}
	
	f();
	g();
	f();
	g();
?>
Return current item: phc