Annotation of embedaddon/php/Zend/tests/traits/bug55372.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #55372 (Literal handling in methods is inconsistent, causing memory corruption)
! 3: --FILE--
! 4: <?php
! 5:
! 6: trait testTrait {
! 7: public function testMethod() {
! 8: if (1) {
! 9: $letters1 = range('a', 'z', 1);
! 10: $letters2 = range('A', 'Z', 1);
! 11: $letters1 = 'foo';
! 12: $letters2 = 'baarr';
! 13: var_dump($letters1);
! 14: var_dump($letters2);
! 15: }
! 16: }
! 17: }
! 18:
! 19: class foo {
! 20: use testTrait;
! 21: }
! 22:
! 23: $x = new foo;
! 24: $x->testMethod();
! 25: ?>
! 26: --EXPECT--
! 27: string(3) "foo"
! 28: string(5) "baarr"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>