-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
phpstan/phpstan-src
#719Description
Bug report
PDO::lastInsertId may return false, as seen in #4243
You should inspect (or have someone do it) php-src to see in which case can PDO::lastInsertId() return FALSE. Then we can assess whether we should add |false to the return type.
Yesterday, @morozov found a case in https://github.com/microsoft/msphpsql/pull/1282/files#diff-d2bd6eeee218880848855ddb059d2198c44ca96422951309b4298c3ec33de388R1517
The conversation about this is at doctrine/dbal#4885 (comment)
Code snippet that reproduces the problem
https://phpstan.org/r/1d6e6c2e-9c38-483d-9e03-e21f4f7ce550 (strict rules are required)
Expected output
No issues.
Did PHPStan help you today? Did it make you happy in any way?
While trying to reproduce the issue on a brand new test repo, it told me I was running it at level=0 with a nice tip. That was nice UX.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels