xref: /PHP-8.3/tests/func/002.phpt (revision 7aacc705)
1--TEST--
2Static variables in functions
3--FILE--
4<?php
5function blah()
6{
7  static $hey=0,$yo=0;
8
9  echo "hey=".$hey++.", ",$yo--."\n";
10}
11
12blah();
13blah();
14blah();
15if (isset($hey) || isset($yo)) {
16  echo "Local variables became global :(\n";
17}
18?>
19--EXPECT--
20hey=0, 0
21hey=1, -1
22hey=2, -2
23