Bug #63812 [Opn->Fbk]: PDO Triggers Warning(s) Regardless of Error Handling Strategy
| From: | cmb@php.net | Date: | Mon, 09 Mar 2020 17:41:52 +0000 |
| Subject: | Bug #63812 [Opn->Fbk]: PDO Triggers Warning(s) Regardless of Error Handling Strategy | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-225983@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63812&edit=1
ID: 63812
Updated by: cmb@php.net
Reported by: sergey at shymko dot net
Summary: PDO Triggers Warning(s) Regardless of Error Handling
Strategy
-Status: Open
+Status: Feedback
Type: Bug
Package: PDO MySQL
Operating System: Linux
PHP Version: 5.3.19
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This issue is supposed to be [1] as of PHP 7.4.0. I don't think
that back-porting the fix to PHP 7.3 makes much sense at this
point.
[1] <http://git.php.net/?p=php-src.git;a=commit;h=2856afc70e50b85424b2bd2d6653020679160a0b>
Previous Comments:
------------------------------------------------------------------------
[2019-02-27 07:29:03] moritz dot friedrich at messengerpeople dot com
This bug is, as of today, more than six years old. Is there anyone on the developer team that might
want to comment on it, provide some information on how to mitigate the issue or at least add a
wontfix flag so we know we'll have to deal with this ourselves?
------------------------------------------------------------------------
[2018-11-09 13:17:32] jferrer at data-solutions dot com
This bug is a ******* joke
I don't understand how something like this is still not fixed in php 7.0.3
This is how i "fixed" it:
// Convert NOTICE, WARNING, ... in Exceptions
$convert_error_to_exception = function ($level, $message, $file, $line, $context=null){
throw new ErrorException($message, 0, $level, $file, $line);
};
set_error_handler($convert_error_to_exception);
I convert Warnings in ErrorException which makes them catchable
------------------------------------------------------------------------
[2017-04-20 15:38:05] justpusher at gmail dot com
We faced this bug too after upgrading our servers to PHP 5.6.30.
Ubuntu 16.04.2 LTS
The test script given in the bug description reproduces the bug.
------------------------------------------------------------------------
[2016-06-15 07:57:47] gaobin3243 at 126 dot com
I have the same problem, regardless PDO::ERRMODE_EXCEPTION I sometimes get warnings or both warnings
and the pdoexception equivalent at the same time (!!!).
------------------------------------------------------------------------
[2016-02-23 09:39:41] oxygenus at gmail dot com
Still present in PHP 7.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=63812
--
Edit this bug report at https://bugs.php.net/bug.php?id=63812&edit=1