-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
mysqli_sql_exception->getSqlState() #7746
Comments
The pattern with exceptions is to keep properties inaccessible and provide a getter method. |
kamil-tekiela
added a commit
to kamil-tekiela/php-src
that referenced
this issue
Dec 10, 2021
kamil-tekiela
added a commit
to kamil-tekiela/php-src
that referenced
this issue
Dec 11, 2021
Create getter instead of making the property public
kamil-tekiela
added a commit
to kamil-tekiela/php-src
that referenced
this issue
Dec 11, 2021
Create getter instead of making the property public
kamil-tekiela
added a commit
to kamil-tekiela/php-src
that referenced
this issue
Dec 14, 2021
Create getter instead of making the property public
kamil-tekiela
added a commit
that referenced
this issue
Dec 30, 2021
kamil-tekiela
added a commit
that referenced
this issue
Dec 30, 2021
* PHP-8.1: Fix bug GH-7746 (mysqli_sql_exception->sqlstate is inaccessible)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Hello,
About
mysqli_sql_exception
:https://www.php.net/manual/en/class.mysqli-sql-exception.php
What's the point of:
protected string $sqlstate;
if we cannot access it?
I was also trying:
But then I get:
Why doesn't
\mysqli_sql_exception
contain agetSqlState()
method?I see some workarounds with using Reflection, etc, but that's obviously not ideal.
At least we can still use
mysqli_sqlstate
, but still...Thank you very much.
The text was updated successfully, but these errors were encountered: