|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-08-20 12:54 UTC] mike@php.net
-Status: Open
+Status: Feedback
[2013-08-20 12:54 UTC] mike@php.net
[2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 23 07:00:01 2025 UTC |
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