We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88db98a commit 2fafe5fCopy full SHA for 2fafe5f
Zend/tests/static_variables_traits.phpt
@@ -0,0 +1,43 @@
1
+--TEST--
2
+Behavior of static variables in trait methods
3
+--FILE--
4
+<?php
5
+
6
+trait T {
7
+ public static function counter() {
8
+ static $i = 0;
9
+ var_dump(++$i);
10
+ }
11
+}
12
13
+class C1 {
14
+ use T {
15
+ T::counter as counter1;
16
+ T::counter as counter2;
17
18
19
20
+class C2 {
21
+ use T;
22
23
24
+C1::counter();
25
+C1::counter1();
26
+C1::counter2();
27
+C2::counter();
28
29
30
31
32
33
34
+?>
35
+--EXPECT--
36
+int(1)
37
38
39
40
+int(2)
41
42
43
0 commit comments