[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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.