2024-09-14 11:52:37

I discovered something yesterday that I could swear was not true.

Neither PHPStorm not PHPStan on strict level 9 ensure that types are correct during simple assignment.

Like:

/** @var string $thing */
$thing = [];

gives NO ERRORS!!!!!

WHAT?!

It only works for class properties and constants?

Wow. I must have known, but I feel like I never knew.