summaryrefslogtreecommitdiff
path: root/Zend/tests/bug70083.phpt
blob: 0391ea23270274f112c88e2863a3d89b6ca19bf8 (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
--TEST--
Bug #70083 (Use after free with assign by ref to overloaded objects)
--FILE--
<?php

class foo {
	private $var;
	function __get($e) {
		return $this;
	}
}

function &noref() { $foo = 1; return $foo; }

$foo = new foo;
$foo->i = &noref();
var_dump($foo);

?>
--EXPECTF--

Fatal error: Uncaught Error: Cannot assign by reference to overloaded object in %s:%d
Stack trace:
#0 {main}
  thrown in %s on line %d