1--TEST--
2A failed assignment should not be considered an initialization
3--FILE--
4<?php
5
6class Test {
7    public int $prop;
8
9    public function __get($name) {
10        echo "__get() called\n";
11        return 0;
12    }
13}
14
15$test = new Test;
16try {
17    $test->prop;
18} catch (Error $e) {
19    echo $e->getMessage(), "\n";
20}
21try {
22    $test->prop = "foo";
23} catch (Error $e) {
24    echo $e->getMessage(), "\n";
25}
26try {
27    $test->prop;
28} catch (Error $e) {
29    echo $e->getMessage(), "\n";
30}
31
32?>
33--EXPECT--
34Typed property Test::$prop must not be accessed before initialization
35Cannot assign string to property Test::$prop of type int
36Typed property Test::$prop must not be accessed before initialization
37