xref: /PHP-7.0/Zend/tests/traits/bug55372.phpt (revision b14b440c)
1--TEST--
2Bug #55372 (Literal handling in methods is inconsistent, causing memory corruption)
3--FILE--
4<?php
5
6trait 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
19class foo {
20	use testTrait;
21}
22
23$x = new foo;
24$x->testMethod();
25?>
26--EXPECT--
27string(3) "foo"
28string(5) "baarr"
29