|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-02-01 09:14 UTC] krakjoe@php.net
-Status: Open
+Status: Not a bug
[2014-02-01 09:14 UTC] krakjoe@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 09:00:01 2025 UTC |
Description: ------------ Passing object that implement ArrayAccess interface to PDO constructor(forth param), the constructor will return NULL, no Exception raised. (I‘m not sure is the bug come from PDO or ArrayAccess.) Test script: --------------- $config = array(...); $options = new SomeObjImplArrAcc(); // just an empty object $pdo = new PDO($config['dsn'],$config['user'],$config['pass'],$options); var_dump($pdo); // <- NULL $options[PDO::ATTR_PERSISTENT] = true; // or have some elements $pdo = new PDO($config['dsn'],$config['user'],$config['pass'],$options); var_dump($pdo); // <- NULL // but success if convert to "native" array $pdo = new PDO($config['dsn'],$config['user'],$config['pass'],(array)$options); var_dump($pdo); // <- {PDO}[0] Expected result: ---------------- construct three same PDO object