-
Notifications
You must be signed in to change notification settings - Fork 7.8k
PDO::getAttribute() behaves differently than document #12032
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
Comments
I got my expectations wrong. The correct is:
|
@Girgias |
Considering there are user notes from 5 years ago that detail workarounds to catch exceptions, I suppose it is the intended behaviour, even if it is weird. I think this is something that could be changed, but might require some discussion on the internals mailing list to gauge what people think is the correct behaviour. |
@Girgias A few days ago, I submitted a proposal on the mailing list to deprecate PDO's error mode attribute. But still no response from anyone... I'll try replying to myself again. |
I plan to open an issue on doc, with the policy of modifying the document except for areas related to error modes. |
I think it is because your emails landed in most people's spam folder. |
Oh, sorry about that. This morning in Japan time, I added SPF settings. I'll wait and see if it will still be marked as spam in this state. |
Description
The following code:
Resulted in this output:
But I expected this output instead:
https://www.php.net/manual/en/pdo.getattribute.php#refsect1-pdo.getattribute-returnvalues
I suspect that the error/warning and returning false instead of null is probably just outdated documentation.
Even so, it is strange that
warning
is output withPDO::ERRMODE_SILENT
.I don't know if the documentation and the implementation need to be fixed, and if so, what should be fixed, so I would like your opinion.
PHP Version
PHP 8.1.22
Operating System
No response
The text was updated successfully, but these errors were encountered: