Hyvor Developer
  Home   Download   Copy
Code
<?php
function test() {
	static $number = 0; // declare static variable
	echo $number . '<br>'; // echo number with line break
	$number = $number + 5; // add five to $number
}

test(); // 0
test(); // 5
test(); // 10
Result