| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2009-02-16 22:31 UTC] felipe@php.net
 Description:
------------
See below.
Reproduce code:
---------------
<?php
$db = new PDO('firebird:dbname=...', 'sysdba', 'foo');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
@$db->exec('drop table test');
$db->exec('CREATE TABLE test(idx int NOT NULL PRIMARY KEY, txt VARCHAR(20))');
$db->exec('INSERT INTO test VALUES(0, \'String0\')');
$stmt = $db->prepare('SELECT idx, txt FROM test ORDER by idx');
$idx = $txt = 0;
$stmt->bindColumn('IDX', $idx);
$stmt->bindColumn('TXT', $txt);
$stmt->execute();
while($stmt->fetch(PDO::FETCH_BOUND)) {
	var_dump(array($idx=>$txt));
}
Actual result:
--------------
array(1) {
  [0]=>
  string(7) "String0"
}
[Mon Feb 16 19:30:09 2009]  Script:  '../test.php'
/home/felipe/dev/php5/main/spprintf.c(775) :  Freeing 0x090E8A64 (79 bytes), script=../test.php
Last leak repeated 1 time
=== Total 2 memory leaks detected ===
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 09:00:01 2025 UTC | 
Using: PHP 5.2.9RC2 (cli) (built: Feb 19 2009 16:29:53) OS: OpenSuse 10.3 Description: ---------------- Any error with PDO will result in a memory leak. Reproduce code: ---------------- while (1) { $test = new PDO($db['dsn'], $db['username'], $db['password']); print "\n".memory_get_usage(); }