Hello! I'm surprised I only now realized this. Is this intended?
<?php
class Dummy
{
}
class Test
{
private ?array $test;
private ?Dummy $dummy;
private int|string $third;
public function testing()
{
if (is_array($this->test)) {
// array|null Test::$test
$this->test;
}
if ($this->test !== null) {
// array|null Test::$test
$this->test;
}
if ($this->dummy instanceof Dummy) {
// Dummy|null Test::$dummy
$this->dummy;
}
if ($this->dummy !== null) {
// Dummy|null Test::$dummy
$this->dummy;
}
if (is_int($this->third)) {
// int|string Test::$third
$this->third;
}
if (is_string($this->third)) {
// int|string Test::$third
$this->third;
}
}
}