bug78810.phpt 457 B

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