xref: /PHP-8.0/Zend/tests/traits/language012.phpt (revision 782352c5)
1--TEST--
2Statics should work in traits, too.
3--FILE--
4<?php
5error_reporting(E_ALL);
6
7trait Counter {
8   public function inc() {
9     static $c = 0;
10     $c = $c + 1;
11     echo "$c\n";
12   }
13}
14
15
16class C1 {
17   use Counter;
18}
19
20$o = new C1();
21$o->inc();
22$o->inc();
23
24?>
25--EXPECT--
261
272
28