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 ee73a0b commit 933c2beCopy full SHA for 933c2be
tests/PHPStan/Rules/Properties/data/bug-7844.php
@@ -0,0 +1,23 @@
1
+<?php
2
+
3
+namespace Bug7844;
4
5
+class C
6
+{
7
+ /** @var float */
8
+ public $val = .0;
9
10
+ /** @var array<float> */
11
+ public $data = array();
12
13
+ public function foo(): void
14
+ {
15
+ \PHPStan\dumpType($this->data);
16
+ if (count($this->data) > 0) {
17
18
+ $this->val = array_shift($this->data);
19
+ \PHPStan\dumpType($this->val);
20
+ }
21
22
+}
23
tests/PHPStan/Rules/Variables/ParameterOutAssignedTypeRuleTest.php
@@ -74,4 +74,9 @@ public function testBug13093b(): void
74
$this->analyse([__DIR__ . '/data/bug-13093b.php'], []);
75
}
76
77
+ public function testBug7844(): void
78
79
+ $this->analyse([__DIR__ . '/data/bug-7844.php'], []);
80
81
82
0 commit comments