Closed huangdijia closed 2 days ago
/** * @return ($a is null ? null : int) */ function test(?int $a = null) { if (is_null($a)) { return null; } return $a; }
Screenshots
$a = 1; $b = test($a); // The return type is right
$a = null; $b = test($a); // The return type is also right
$b = test(); // The return type is wrong
Platform and version
版本: 1.90.2 (Universal) 提交: 5437499feb04f7a586f677b155b039bc2b3669eb 日期: 2024-06-18T22:37:41.291Z Electron: 29.4.0 ElectronBuildId: 9728852 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Darwin x64 20.6.0
Thankyou for reporting!
Screenshots
Platform and version