bug55825.phpt 262 B

123456789101112131415161718
  1. --TEST--
  2. Bug #55825 (Missing initial value of static locals in trait methods)
  3. --FILE--
  4. <?php
  5. trait T1 {
  6. public function inc() {
  7. static $x=1;
  8. echo $x++ . "\n";
  9. }
  10. }
  11. class C { use T1; }
  12. $c1 = new C;
  13. $c1->inc();
  14. $c1->inc();
  15. ?>
  16. --EXPECT--
  17. 1
  18. 2