|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70822 oci_bind_by_name doesn't work with variables in arrays
Submitted: 2015-10-30 13:02 UTC Modified: 2016-03-08 00:56 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: wingman at ip-home dot net Assigned: sixd (profile)
Status: Closed Package: OCI8 related
PHP Version: 7.0.0RC6 OS: Gentoo 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: wingman at ip-home dot net
New email:
PHP Version: OS:


 [2015-10-30 13:02 UTC] wingman at ip-home dot net
php7 + occi does not bind variables by name when variables are in array.

Same script with php5.6 works well

Test script:
Test script with error:

Result is empty, because variables are not bound :(

This code works well with php5.6


Same script, but variables are bound directly, without array/foreach:

oci returns result from DB


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-31 08:37 UTC] wingman at ip-home dot net
Some workaround:

---- dont works: ----

$args = [ [$p1, $v1],  [$p2, $v2] ];
foreach( $args as $a ) {
    oci_bind_by_name($sth, $a[0], $a[1], -1);

---- works: ----

foreach( $args as $a ) {
    $temp1 = &$a[0];
    $temp2 = &$a[1];
    oci_bind_by_name($sth, $a[0], $a[1], -1);
 [2015-10-31 10:04 UTC] wingman at ip-home dot net
fixed by:

- foreach( $args as $a ) {
+ foreach( $args as &$a ) {
 [2015-10-31 10:05 UTC] wingman at ip-home dot net
-Status: Open +Status: Closed
 [2015-10-31 10:05 UTC] wingman at ip-home dot net
not a bug
 [2016-03-08 00:56 UTC]
-Package: Oracle related +Package: OCI8 related -Assigned To: +Assigned To: sixd
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Feb 21 13:01:28 2024 UTC