Bug report
This doesn't occur on 0.11.19, it seems new to 0.12.0.
The bug is hard to explain, I'll let the code do the talking.
Code snippet that reproduces the problem
<?php
declare(strict_types=1);
class MyClass{
public $t = 0;
public function test() : void{
$this->t = 0;
$this->bump();
if($this->t >= 1){
echo "hi";
}
}
private function bump() : int{
++$this->t;
return 0;
}
}
Broken:
https://phpstan.org/r/e44e4d31-98eb-44c0-8bcb-5452b6c67bf2
Strange that if bump() returns void, no error is reported, ex: https://phpstan.org/r/975a9409-6b28-438e-b5dd-81d4d9a1684d
Expected output
No error should be reported.
Bug report
This doesn't occur on 0.11.19, it seems new to 0.12.0.
The bug is hard to explain, I'll let the code do the talking.
Code snippet that reproduces the problem
Broken:
https://phpstan.org/r/e44e4d31-98eb-44c0-8bcb-5452b6c67bf2
Strange that if
bump()returnsvoid, no error is reported, ex: https://phpstan.org/r/975a9409-6b28-438e-b5dd-81d4d9a1684dExpected output
No error should be reported.