|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-07-20 10:12 UTC] nikic@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: nikic
[2016-07-20 10:12 UTC] nikic@php.net
[2016-07-20 10:29 UTC] cmb@php.net
[2016-07-21 02:29 UTC] kazu9su at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 00:00:01 2025 UTC |
Description: ------------ PDO contructer return null and output warning() when given unexpected type arguments. I think it is better that throw PDO exception with relevant message or update PHPDoc to indicate this specification. How about that? Test script: --------------- <?php try { $pdo = new PDO('pgsql:host=db;dbname=hoge', 'postgres', [], []); var_dump(is_null($pdo)); } catch(PDOException $e) { var_dump($e->getMessage()); } Expected result: ---------------- string(64) "PDO::__construct() expects parameter 3 to be string, array given" Actual result: -------------- Warning: PDO::__construct() expects parameter 3 to be string, array given in /Users/kazushige.tominaga/test-prestissimo/hoge.php on line 2 bool(true)