summaryrefslogtreecommitdiff
path: root/Zend/tests/bug71300.phpt
blob: 3589c4764e8521f551bf9c9580249f461c518f59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
Bug #71300 (Segfault in zend_fetch_string_offset)
--FILE--
<?php
function test1() {
	for ($n = 'a'; $n < 'g'; $n++) {
		$$n = 1;
	}
	$$n = $$n[++$n] = "test";
	return $$n;
}

var_dump(test1());

function test2() {
    /* See #71303 for why not using for loop here */
	$n = "a";
	$$n .= $$n[++$n] = "test";
	return $$n;
}

var_dump(test2());
?>
--EXPECTF--
string(4) "test"

Notice: Array to string conversion in %sbug71300.php on line %d
string(9) "Arraytest"