Skip to content
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

Call to an undefined method mysqli::execute_query(). #8058

Closed
staabm opened this issue Sep 25, 2022 · 7 comments · Fixed by phpstan/phpstan-src#1762
Closed

Call to an undefined method mysqli::execute_query(). #8058

staabm opened this issue Sep 25, 2022 · 7 comments · Fixed by phpstan/phpstan-src#1762
Labels
Milestone

Comments

@staabm
Copy link
Contributor

staabm commented Sep 25, 2022

Bug report

since php 8.2 the mysqli class should have a method execute_query defined, see https://wiki.php.net/rfc/mysqli_execute_query

Code snippet that reproduces the problem

https://phpstan.org/r/f98680cc-3a15-4ed2-aff7-7da225c41f36

Expected output

no error

Did PHPStan help you today? Did it make you happy in any way?

@ondrejmirtes
Copy link
Member

We need to update PhpStorm stubs, I've been postponing that because of this build failure https://github.com/phpstan/phpstan-src/actions/runs/3086479438/jobs/4990860388

1) PHPStan\Reflection\ReflectionProviderTest::testFunctionThrowType with data set #4 ('random_int', PHPStan\Type\ObjectType Object (...))
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'Exception'
+'\Exception'

Feel free to debug and fix what's the reason behind this test failure.

@ondrejmirtes ondrejmirtes added this to the Easy fixes milestone Sep 25, 2022
@rvanvelzen
Copy link
Contributor

@phpstan-bot
Copy link
Contributor

@rvanvelzen After the latest push in 1.8.x, PHPStan now reports different result with your code snippet:

@@ @@
-12: Dumped type: \Exception
+12: Dumped type: Exception
Full report
Line Error
12 Dumped type: Exception

@phpstan-bot
Copy link
Contributor

@staabm After the latest push in 1.8.x, PHPStan now reports different result with your code snippet:

@@ @@
-PHP 8.2 (1 error)
+PHP 8.2
 ==========
 
- 9: Call to an undefined method mysqli::execute_query().
+No errors
 
 PHP 7.1 – 8.1 (2 errors)
 ==========
Full report

PHP 8.2

No errors

PHP 7.1 – 8.1 (2 errors)

Line Error
9 Call to an undefined method mysqli::execute_query().
11 Function mysqli_execute_query not found.

@staabm
Copy link
Contributor Author

staabm commented Sep 26, 2022

excellent. should I bring in a regression test, or can we just close?

@ondrejmirtes
Copy link
Member

Regression test would be nice, thanks

@github-actions
Copy link

github-actions bot commented Nov 4, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants