Bug #70822 [Opn->Csd]: oci_bind_by_name doesn't work with variables in arrays

From: Date: Sat, 31 Oct 2015 10:05:11 +0000
Subject: Bug #70822 [Opn->Csd]: oci_bind_by_name doesn't work with variables in arrays
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196942@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70822&edit=1 ID: 70822 User updated by: wingman at ip-home dot net Reported by: wingman at ip-home dot net Summary: oci_bind_by_name doesn't work with variables in arrays -Status: Open +Status: Closed Type: Bug Package: Oracle related Operating System: Gentoo Linux PHP Version: 7.0.0RC6 Block user comment: N Private report: N New Comment: not a bug Previous Comments: ------------------------------------------------------------------------ [2015-10-31 10:04:37] wingman at ip-home dot net fixed by: - foreach( $args as $a ) { + foreach( $args as &$a ) { ------------------------------------------------------------------------ [2015-10-31 08:37:15] 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-30 13:02:57] wingman at ip-home dot net Description: ------------ 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: http://pastebin.com/ggdRKF3m 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: http://pastebin.com/7NTmN9DB oci returns result from DB ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70822&edit=1

« previous php.bugs (#196942) next »