1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
--TEST-- Exception thrown by __get() during =& assignment --FILE-- <?php class Test { private $x; public function &__get($name) { throw new Exception("Foobar"); } } $test = new Test; $y = 5; try { $test->x =& $y; } catch (Exception $e) { echo $e->getMessage(), "\n"; } ?> --EXPECT-- Foobar