Bug #64035 [NEW]: In constructing \PDO an empty Fatal Error appears

From: Date: Mon, 21 Jan 2013 11:14:08 +0000
Subject: Bug #64035 [NEW]: In constructing \PDO an empty Fatal Error appears
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-176149@lists.php.net to get a copy of this message
From: lionishy at gmail dot com Operating system: Windows 8 PHP version: 5.4.11 Package: PDO related Bug Type: Bug Bug description:In constructing \PDO an empty Fatal Error appears Description: ------------ When I construct an object I expect an exception to be thrown when there's any problem. Still, on Windows 8 I get the Fatal Error with no message, while expecting Fatal Error: Uncaught Exception. Moreover, if \PDOException is caught and any other type exception is thrown, normal Fatal Error: Uncaught Exception <bla bla bla> appears. Test script: --------------- <?php /** * an empty Fatal Error appears */ $pdo = new \PDO('mysql:host=localhost;dbname=test','user','password'); /** * an expected Fatal Error Uncaught Exception apperas */ try { $pso = new \PDO('mysql:host=localhost;dbname=test','user','password'); } catch(\PDOException $ex) { throw new Exception('\PDO Exception\'s been caught!'); } /** * an empty Fatal Error appears again */ try { $pso = new \PDO('mysql:host=localhost;dbname=test','user','password'); } catch(\PDOException $ex) { throw new Exception($ex->getMessage()); } Expected result: ---------------- Fatal Error: Uncaught Exception '\PDOException' with message '<message goes here>' in test.php on line 5 Actual result: -------------- Fatal Error: in test.php on line 5 -- Edit bug report at https://bugs.php.net/bug.php?id=64035&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64035&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64035&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64035&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64035&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64035&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64035&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64035&r=needscript Try newer version: https://bugs.php.net/fix.php?id=64035&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=64035&r=support Expected behavior: https://bugs.php.net/fix.php?id=64035&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64035&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64035&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64035&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64035&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64035&r=dst IIS Stability: https://bugs.php.net/fix.php?id=64035&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=64035&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64035&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64035&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64035&r=mysqlcfg

« previous php.bugs (#176149) next »