|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62367 OCI8 statement not fully freed if bind data contains references
Submitted: 2012-06-19 22:53 UTC Modified: 2021-07-11 04:22 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: galaxy dot mipt at gmail dot com Assigned: cmb (profile)
Status: No Feedback Package: OCI8 related
PHP Version: 5.4.4 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: galaxy dot mipt at gmail dot com
New email:
PHP Version: OS:


 [2012-06-19 22:53 UTC] galaxy dot mipt at gmail dot com
Probably I miss some point here but anyway - in the test script below bind data is passed to the query() function as an array from pre-created collection.
On each call memory consumption grows by pretty huge value (~65kB) even though oci_free_statement() is called.
The important conditions to reproduce:
  1. Bind array contains references. Without those I get

  2. PL/SQL script actually writes to one of bound variables. With the second (currently commented out) version I get

Test script:
function query($data) {
    global $conn;
    $stid = oci_parse($conn, 'begin select :a + :b into :b from dual; end;');
    //$stid = oci_parse($conn, 'declare j number; begin select :a + :b into j from dual; end;');

    oci_bind_by_name($stid, ':a', $data['a'], 100);
    oci_bind_by_name($stid, ':b', $data['b'], 100);


$conn = oci_connect('user', 'pass', 'dbref');
if (!$conn) {
    $e = oci_error();

$data = array();
for($i = 0; $i < 1000; $i++) {
    $data[] = array(
        "a"   => 1,
        "b"   => 2

print memory_get_usage() . "\n";
for($i = 0; $i < 100; $i++) {
            "a" => &$data[$i]["a"],
            "b" => &$data[$i]["b"]
print memory_get_usage() . "\n";


Expected result:

Actual result:
639520 or nor far from this


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-19 22:56 UTC] galaxy dot mipt at gmail dot com
Oh, I swapped actual and expected results by mistake
 [2021-06-29 15:37 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-06-29 15:37 UTC]
Is this still an issue with any of the actively supported PHP

[1] <>
 [2021-07-11 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 12 13:01:33 2024 UTC