Bug #71941 [NEW]: Setting PDO::ATTR_ERRMODE to PDO::ERRMODE_SILENT does NOT work
From: belliash at asiotec dot eu dot org
Operating system: ALL
PHP version: 7.0.5
Package: PDO Core
Bug Type: Bug
Bug description:Setting PDO::ATTR_ERRMODE to PDO::ERRMODE_SILENT does NOT work
Description:
------------
As you can see in above example (https://3v4l.org/0hf0u) I am setting
PDO::ATTR_ERRMODE to PDO::ERRMODE_SILENT but somehow it does not make
$pdo->getAttribute() silent. It is throwing an exception or warning,
depending on setting, but it is IMPOSSIBLE to make it silent.
Test script:
---------------
$pdo = new \PDO('sqlite::memory:');
$pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_SILENT);
$pdo->getAttribute(1);
Expected result:
----------------
NO WARNING
Actual result:
--------------
Warning: SQLSTATE[IM001]: Driver does not support this function: driver
does not support that attribute in /in/0hf0u on line 6
--
Edit bug report at https://bugs.php.net/bug.php?id=71941&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71941&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71941&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71941&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71941&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71941&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71941&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71941&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71941&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71941&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71941&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71941&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71941&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71941&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71941&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71941&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71941&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71941&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71941&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71941&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71941&r=mysqlcfg
Thread (4 messages)
- belliash at asiotec dot eu dot org