We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef89f51 commit 1075c68Copy full SHA for 1075c68
tests/PHPStan/Analyser/nsrt/bug-12393b.php
@@ -238,6 +238,24 @@ public function doBar(): void
238
}
239
240
241
+class FooNullableIntString
242
+{
243
+
244
+ public string $foo;
245
246
+ public function doFoo(?int $b): void
247
+ {
248
+ $this->foo = $b;
249
+ assertType('string', $this->foo); // could be numeric-string
250
+ }
251
252
+ public function doBar(): void
253
254
+ $this->foo = null;
255
+ assertType('*NEVER*', $this->foo); // null cannot be coerced to string, see https://3v4l.org/5k1Dl
256
257
+}
258
259
class FooFloatString
260
{
261
0 commit comments