|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60624 Incorrect Invalid variable used for bind error
Submitted: 2011-12-29 11:35 UTC Modified: 2012-10-26 05:18 UTC
Avg. Score:4.5 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:1 (25.0%)
From: 935c at itsynergy dot co dot uk Assigned: sixd (profile)
Status: No Feedback Package: OCI8 related
PHP Version: 5.3.8 OS: Scientific Linux 6.1
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-12-29 11:35 UTC] 935c at itsynergy dot co dot uk
I am seeing the following errors generated for no apparent reason when a function 
is used as a string source:
PHP Warning:  oci_bind_by_name(): Invalid variable used for bind
PHP Warning:  oci_execute(): ORA-01008: not all variables bound

If I replace the $sim_token parameter in my FS_ORA_NEW_SIMTOKEN call with a 
static string, e.g. "2", then it all works fine.

Test script:
-- The OCI8 Call --
function FS_ORA_NEW_SIMTOKEN($p_sess,$p_tkn) {
        $c = FS_ORA_CONNECT();
        $s = oci_parse($c, "begin fs_pkg_XXXXX.new_auth(:p_sess,:p_sim);end;");
        return $exec_status;
-- The Token Generator--
        'mode' => 'AUTH',
        'user' => FS_SIM_UNA,
        'expiry' => $valid_time,
        'key' => $sesskey
        $tokres=FS_SIMAPI_SIMPLEPOST("XXXXXXX AUTH",$qry_array);
        if ($tokres==false) {
                return false;
        try {
        $xmlp=new SimpleXMLElement($tokres);
        } catch (Exception $e) {
                foreach(libxml_get_errors() as $error_line) {
                $error_msg = "SimpleXML: ".$error_line->message;
        return false;
        return $xmlp->results->token;
-- The Application Call--
// 4 XXXXXX Token
if($sim_token!=false) {
if($sim_to_db==false) {
    header("Location: " . FS_APP_HOME_URI . "?autherr=" . urlencode(FS_ERR_SIMFAIL));
} else {
    header("Location: " . FS_APP_HOME_URI . "?autherr=" . urlencode($sim_token));


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-29 11:37 UTC] 935c at itsynergy dot co dot uk
OCI8 Support	enabled
Version	1.4.6
Revision	$Revision: 313688 $
Active Persistent Connections	0
Active Connections	0
Oracle Run-time Client Library Version
Oracle Version	11.2
Compile-time ORACLE_HOME	/u01/app/oracle/product/11.2.0/xe
Libraries Used	-Wl,-rpath,/u01/app/oracle/product/11.2.0/xe/lib -
L/u01/app/oracle/product/11.2.0/xe/lib -lclntsh
Temporary Lob support	enabled
Collections support	enabled

Directive	Local Value	Master Value
oci8.connection_class	no value	no value
oci8.default_prefetch	100	100	Off	Off
oci8.max_persistent	-1	-1
oci8.old_oci_close_semantics	Off	Off
oci8.persistent_timeout	-1	-1
oci8.ping_interval	60	60
oci8.privileged_connect	Off	Off
oci8.statement_cache_size	20	20
 [2011-12-29 13:47 UTC] 935c at itsynergy dot co dot uk
update php version
 [2011-12-29 13:47 UTC] 935c at itsynergy dot co dot uk
-PHP Version: Irrelevant +PHP Version: 5.3.8
 [2012-01-27 00:20 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

Can you give a concrete example of a failing $p_tkn token?  Also what is the 
fs_pkg signature? Do the oci_bind_by_name calls return errors?
 [2012-01-27 00:20 UTC]
-Status: Open +Status: Feedback
 [2012-02-23 21:47 UTC]
-Assigned To: +Assigned To: sixd
 [2012-10-26 05:18 UTC]
-Status: Feedback +Status: No Feedback
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 13:01:31 2024 UTC