xref: /PHP-7.0/Zend/tests/bug70083.phpt (revision 3e3d0290)
1--TEST--
2Bug #70083 (Use after free with assign by ref to overloaded objects)
3--FILE--
4<?php
5
6class foo {
7	private $var;
8	function __get($e) {
9		return $this;
10	}
11}
12
13function &noref() { $foo = 1; return $foo; }
14
15$foo = new foo;
16$foo->i = &noref();
17var_dump($foo);
18
19?>
20--EXPECTF--
21
22Fatal error: Uncaught Error: Cannot assign by reference to overloaded object in %s:%d
23Stack trace:
24#0 {main}
25  thrown in %s on line %d
26
27