Skip to content

Fixed incorrect return type of PDO::quote()#2926

Closed
rasmus0201 wants to merge 1 commit intophpstan:1.11.xfrom
rasmus0201:bug-10512
Closed

Fixed incorrect return type of PDO::quote()#2926
rasmus0201 wants to merge 1 commit intophpstan:1.11.xfrom
rasmus0201:bug-10512

Conversation

@rasmus0201
Copy link
Copy Markdown

@phpstan-bot
Copy link
Copy Markdown
Collaborator

You've opened the pull request against the latest branch 1.11.x. If your code is relevant on 1.10.x and you want it to be released sooner, please rebase your pull request and change its target to 1.10.x.

@VincentLanglet
Copy link
Copy Markdown
Contributor

Friendly ping @ondrejmirtes you might have missed this "easy" PR to review or do you also want a non-regression test for such changes ?

@ondrejmirtes
Copy link
Copy Markdown
Member

I didn't merge this yet because I'm not sure about this change.

The documentation states:

Returns false if the driver does not support quoting in this way.

So a benevolent union type might be the better choice here - __benevolent<string|false>.

Also the usage of this function at all is not recommended in favor of prepared statements.

That's why I didn't rush to merge this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PDO::quote() string|false - Strict comparison using === between string and false will always evaluate to false.

4 participants