bug55372.phpt 530 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Bug #55372 (Literal handling in methods is inconsistent, causing memory corruption)
  3. --FILE--
  4. <?php
  5. trait testTrait {
  6. public function testMethod() {
  7. if (1) {
  8. $letters1 = range('a', 'z', 1);
  9. $letters2 = range('A', 'Z', 1);
  10. $letters1 = 'foo';
  11. $letters2 = 'baarr';
  12. var_dump($letters1);
  13. var_dump($letters2);
  14. }
  15. }
  16. }
  17. class foo {
  18. use testTrait;
  19. }
  20. $x = new foo;
  21. $x->testMethod();
  22. ?>
  23. --EXPECT--
  24. string(3) "foo"
  25. string(5) "baarr"