1--TEST--
2Cannot assign by reference to overloaded object, even if __get() returns by-ref
3--FILE--
4<?php
5
6class Test {
7    private $x;
8    public function &__get($name) {
9        return $this->x;
10    }
11}
12
13$test = new Test;
14$y = 5;
15$test->x =& $y;
16var_dump($test->x);
17
18?>
19--EXPECTF--
20Fatal error: Uncaught Error: Cannot assign by reference to overloaded object in %s:%d
21Stack trace:
22#0 {main}
23  thrown in %s on line %d
24