#48038 [Opn->Csd]: odbc_execute changes variables used to form params array
| From: | felipe@php.net | Date: | Fri, 01 May 2009 03:07:44 +0000 |
| Subject: | #48038 [Opn->Csd]: odbc_execute changes variables used to form params array | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-136614@lists.php.net to get a copy of this message | ||
ID: 48038
Updated by: felipe@php.net
Reported By: szeleung dot poon at gmail dot com
-Status: Open
+Status: Closed
Bug Type: ODBC related
Operating System: Linux linux1 2.6.26-1-686 #1 SMP
PHP Version: 5.2.9
New Comment:
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
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Fixed in 5.2.9, 5.3 and HEAD.
Previous Comments:
------------------------------------------------------------------------
[2009-04-21 16:37:25] szeleung dot poon at gmail dot com
Description:
------------
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:
---------------
<?php
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) {
[0]=>
bool(false)
}
After odbc: bool(false)
array(1) {
[0]=>
string(0) ""
}
Actual result:
--------------
Before odbc: bool(false)
array(1) {
[0]=>
bool(false)
}
After odbc: string(0) ""
array(1) {
[0]=>
string(0) ""
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48038&edit=1