|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48038 odbc_execute changes variables used to form params array
Submitted: 2009-04-21 16:37 UTC Modified: 2009-05-01 03:07 UTC
From: szeleung dot poon at gmail dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 5.2.9 OS: Linux linux1 2.6.26-1-686 #1 SMP
Private report: No CVE-ID:
 [2009-04-21 16:37 UTC] szeleung dot poon at gmail dot com
The odbc_execute documentation says that...

Elements of this array will be converted to strings by calling this function.

However in what I encountered, more than the array is changed. Variables used to form the param array are changed as well.

Reproduce code:
header("content-type: text/plain");
require_once(dirname(__FILE__)."/config.php"); // define connect params
$odbc = odbc_connect(ODBC_DSN, Username, Password);
$b = false;
$b2 = $b;
$params = array($b2);
Before odbc: <?php var_dump($b, $params); ?>
<?php odbc_execute(odbc_prepare($odbc, "SELECT ?"), $params); ?>
After odbc: <?php var_dump($b, $params); ?>

Expected result:
Before odbc: bool(false)
array(1) {
After odbc: bool(false)
array(1) {
  string(0) ""

Actual result:
Before odbc: bool(false)
array(1) {
After odbc: string(0) ""
array(1) {
  string(0) ""


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-01 03:07 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

Fixed in 5.2.9, 5.3 and HEAD.
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Wed Dec 02 06:01:39 2015 UTC