[GIT-PULLS] [php-src] PR #23070: Honor ERRMODE_SILENT in pdo_raise_impl_error
[email protected] (iliaal)
| Newsgroups | php.git-pulls |
|---|---|
| Message-ID | <[email protected]> |
Pull Request: https://github.com/php/php-src/pull/23070 Author: iliaal ERRMODE_SILENT is documented to record the error without raising anything, but pdo_raise_impl_error falls through to php_error_docref for every mode except EXCEPTION, so `$pdo->getAttribute(123456)` warns under SILENT. The early return is there, disabled behind #if 0, because returning ahead of the memcpy left errorInfo() reporting the previous SQLSTATE. Copying the code first and returning after it drops the warning and keeps errorInfo() accurate. GH-12032 reported the same behaviour, and the suggestion there was that changing it may want internals discussion, so this targets master rather than a stable branch.