Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<?php
function add1() {
  static $number = 0;
  $number++;
  return $number;
}
echo add1();
echo "<br>";
echo add1();
echo "<br>";
echo add1();
?>
</body>
<!-- Mirrored from www.w3schools.com/php/phptryit.asp?filename=tryphp_keyword_static2 by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:22:56 GMT -->
</html>
1
2
3