xref: /PHP-8.1/Zend/tests/bug78810.phpt (revision 266f3a02)
1--TEST--
2Bug #78810: RW fetches do not throw "uninitialized property" exception
3--FILE--
4<?php
5
6class Test {
7    public int $i;
8}
9
10$test = new Test;
11try {
12    $test->i++;
13} catch (Error $e) {
14    echo $e->getMessage(), "\n";
15}
16try {
17    $test->i += 1;
18} catch (Error $e) {
19    echo $e->getMessage(), "\n";
20}
21
22?>
23--EXPECT--
24Typed property Test::$i must not be accessed before initialization
25Typed property Test::$i must not be accessed before initialization
26