Edit report at http://bugs.php.net/bug.php?id=47407&edit=1
ID: 47407 Updated by: [email protected] Reported by: dennis at born05 dot nl Summary: There can be only one PDO (derived) instance with ATTR_PERSISTENT Status: Open Type: Bug Package: PDO related Operating System: Fedora Core 6 -PHP Version: 5.2CVS-2009-02-16 (snap) +PHP Version: 5.2, 5.3, trunk New Comment: 5.2SVN: object(MyPDO)#1 (0) { } object(MyPDO)#2 (0) { } [Mon Jun 21 18:46:40 2010] Script: '../bug.php' /home/felipe/dev/php5_2/ext/pdo/pdo_dbh.c(1517) : Freeing 0x0864D85C (44 bytes), script=../bug.php [Mon Jun 21 18:46:40 2010] Script: '../bug.php' /home/felipe/dev/php5_2/ext/pdo/pdo_dbh.c(1518) : Freeing 0x0864ED0C (32 bytes), script=../bug.php /home/felipe/dev/php5_2/Zend/zend_alloc.c(2391) : Actual location (location was relayed) === Total 2 memory leaks detected === 5.3SVN: object(PDO)#1 (0) { } object(PDO)#2 (0) { } Previous Comments: ------------------------------------------------------------------------ [2009-02-16 12:53:48] dennis at born05 dot nl Description: ------------ When you create 2 or more instances of PDO (or derived) with ATTR_PERSISTENT you end up with several references to only one object. Reproduce code: --------------- <?php class MyPDO extends PDO {} $bar = new PDO("sqlite::memory:", null, null, array(PDO::ATTR_PERSISTENT => true)); $baz = new MyPDO("sqlite::memory:", null, null, array(PDO::ATTR_PERSISTENT => true)); var_dump ($bar); var_dump ($baz); ?> Expected result: ---------------- object(PDO)#1 (0) { } object(MyPDO)#2 (0) { } Actual result: -------------- object(MyPDO)#1 (0) { } object(MyPDO)#2 (0) { } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=47407&edit=1
