New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ini_get() analysis should be aware of whether an option exists or not #3063
Comments
Yeah, a simple dynamic return type extension would solve this. |
@dktapps PHPStan now reports different result with your code snippet: @@ @@
-7: Parameter #1 $str of function substr expects string, string|false given.
+7: Parameter #1 $string of function substr expects string, string|false given. Full report
|
@dktapps After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
- 7: Parameter #1 $str of function substr expects string, string|false given.
+-1: Internal error: PHPStan\Rules\Methods\WrongCaseOfInheritedMethodRule::findMethod(): Argument #2 ($classReflection) must be of type PHPStan\Reflection\ClassReflection, null given, called in /var/task/vendor/phpstan/phpstan-strict-rules/src/Rules/Methods/WrongCaseOfInheritedMethodRule.php on line 40
+Run PHPStan with --debug option and post the stack trace to:
+https://github.com/phpstan/phpstan/issues/new?template=Bug_report.md Full report
|
Implemented by phpstan/phpstan-src#2362 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature request
ini_get()
returnsfalse
only when the directive specified does not exist.substr()
will never receivefalse
in this code because thedate.timezone
ini directive always exists.https://phpstan.org/r/6cdcdcb9-aa0c-4848-b727-4b2cf8e225e7
The above code should not report any errors.
The text was updated successfully, but these errors were encountered: