summaryrefslogtreecommitdiff
path: root/Zend/tests/exception_during_by_reference_magic_get.phpt
blob: 5732e8cc5af7966775b846383c7b40b9bd44279d (plain)
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