📄 Viewing: exception_during_by_reference_magic_get.phpt

--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

🌑 DarkStealth — WP Plugin Edition

Directory: /usr/src/php-7.4.23/Zend/tests