summaryrefslogtreecommitdiff
path: root/Zend/tests/method_static_var.phpt
blob: 06574732d75609848d6612cd6bc34cfec932f010 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--TEST--
Initial value of static var in method depends on the include time of the class definition
--FILE--
<?php

/* The current behavior is probably a bug, but we should still test how it currently works. */

class Foo {
    public static function test() {
        static $i = 0;
        var_dump(++$i);
    }
}

Foo::test();
eval("class Bar extends Foo {}");
Foo::test();

Bar::test();
Bar::test();
?>
--EXPECT--
int(1)
int(2)
int(2)
int(3)