xref: /PHP-8.4/tests/lang/007.phpt (revision f8d79582)
1--TEST--
2Function call with global and static variables
3--FILE--
4<?php
5error_reporting(0);
6$a = 10;
7
8function Test()
9{
10    static $a=1;
11    global $b;
12    $c = 1;
13    $b = 5;
14    echo "$a $b ";
15    $a++;
16    $c++;
17    echo "$a $c ";
18}
19
20Test();
21echo "$a $b $c ";
22Test();
23echo "$a $b $c ";
24Test();
25?>
26--EXPECT--
271 5 2 2 10 5  2 5 3 2 10 5  3 5 4 2
28