diff --git a/tests/PHPStan/Analyser/nsrt/pr-5447.php b/tests/PHPStan/Analyser/nsrt/pr-5447.php new file mode 100644 index 0000000000..172f908f26 --- /dev/null +++ b/tests/PHPStan/Analyser/nsrt/pr-5447.php @@ -0,0 +1,37 @@ +nullable(); + if ($device === null) { + $device = 1; + try { + $device = $this->throwsException(); + } catch (\Exception) { + $device = $this->nullable(); + assertType('int|null', $device); + } + } + } + + public function nullable(): ?int + { + + } + + /** @throws \Exception */ + private function throwsException(): int + { + + } + +}