<?php declare(strict_types = 1);
use function PHPStan\dumpType;
use function PHPStan\Testing\assertType;
function test_strings(string $a, string $b): void
{
if ($a !== '' && strtolower($a) === $a) {
assertType('lowercase-string&non-empty-string', $a);
} elseif ($a !== '' && strtolower($a) === $a) {
assertType('non-empty-string&uppercase-string', $a);
}
if (strtolower($b) === $b && $b !== '') {
assertType('lowercase-string&non-empty-string', $b);
} elseif (strtoupper($b) === $b && $b !== '') {
assertType('non-empty-string&uppercase-string', $b);
}
}
I expect regardless of order, the asserted type would be the same.
Bug report
This code:
Code snippet that reproduces the problem
https://phpstan.org/r/71e2eac7-39d2-4544-b3c2-5b36c824647f
Expected output
I expect regardless of order, the asserted type would be the same.
Did PHPStan help you today? Did it make you happy in any way?
Oh, yes!