xref: /PHP-7.3/tests/func/002.phpt (revision 782352c5)
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--EXPECT--
19hey=0, 0
20hey=1, -1
21hey=2, -2
22