|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73206 oci_bind_by_name/oci_execute doesn't work properly
Submitted: 2016-09-30 02:58 UTC Modified: 2016-10-13 04:46 UTC
From: sergei dot solomonov at gmail dot com Assigned:
Status: Duplicate Package: OCI8 related
PHP Version: 7.1.0RC3 OS: Ubuntu 15.04
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: sergei dot solomonov at gmail dot com
New email:
PHP Version: OS:


 [2016-09-30 02:58 UTC] sergei dot solomonov at gmail dot com
Tested with 7.09 and 7.1.0RC3 on Ubuntu 15.04.
Default php.ini-development config was used.

Configure command:
'./configure' '--enable-zip' '--enable-intl' '--with-oci8' '--enable-dbase' '--disable-cgi' '--with-apxs2=/usr/local/apache/bin/apxs' '--enable-opcache' '--enable-sigchild' '--enable-mbstring' '--with-xsl' '--with-gd' '--with-config-file-scan-dir=/usr/local/apache/conf' '--with-openssl' '--with-curl' '--with-zlib' '--enable-timezonedb'

Example below leads to incorrect result. In case bind value 8 or more chars length returns `false`, if less than 8 - returns correct result.
It may be related with
For now, its impossible to work with PHP 7 and Oracle DB looks very unstable and buggy. Can't use any php7 version in prod.

Test script:
class Statement {
    public $resource;
    function __construct($sql) {
        $conn = oci_connect(getenv('db_login'), getenv('db_pwd'), getenv('db_host'));
        $this->resource = oci_parse($conn, $sql);

    public function errorHandler($severity, $message, $file = '', $line = 0) {
        var_dump($message, 0, $severity, $file, $line);

    function execute() {
        set_error_handler([$this, 'errorHandler']);

    function bindParams(array $bindParams = []) {
        foreach ($bindParams as $bvn => &$bvv) {
            oci_bind_by_name($this->resource, $bvn, $bvv);

    function fetch() {
        return oci_fetch_array($this->resource);

$stmt = new Statement("select * from dual where :param = 'xxxxxxxx'");
$stmt->bindParams(['param' => 'xxxxxxxx']);

Expected result:
array(2) {
  string(1) "X"
  string(1) "X"

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-10-13 04:46 UTC]
-Status: Open +Status: Duplicate
 [2016-10-13 04:46 UTC]
Seems fixed by the patch in bug #71148.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 10:01:28 2024 UTC