|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-02-16 12:53 UTC] 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) {
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 03:00:01 2025 UTC |
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) { }