|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26312 bug in raiseError in DB/common.php
Submitted: 2003-11-19 05:37 UTC Modified: 2003-11-19 09:43 UTC
From: wilfrid at digifactory dot fr Assigned:
Status: Not a bug Package: *Database Functions
PHP Version: 5.0.0b2 (beta2) OS: redhat 9
Private report: No CVE-ID: None
 [2003-11-19 05:37 UTC] wilfrid at digifactory dot fr
In the standard include DB/common.php (/usr/local/lib/php) there is a bug on the raiseError function : 
Fatal error: Only variables or references can be returned by reference in /usr/local/lib/php/DB/common.php on line 298  

At this line, there is this : 
return PEAR::raiseError(null, $code, $mode, $options, $userinfo,'DB_Error', true);

I don't know what is the problem (i'm just transfering severals website on a new server using php5), but the website have no problem on the previous server using php4...

Reproduce code:
    function &raiseError($code = DB_ERROR, $mode = null, $options = null,
                         $userinfo = null, $nativecode = null)
        // The error is yet a DB error object
        if (is_object($code)) {
            // because we the static PEAR::raiseError, our global
            // handler should be used if it is set
            if ($mode === null && !empty($this->_default_error_mode)) {
                $mode    = $this->_default_error_mode;
                $options = $this->_default_error_options;
            return PEAR::raiseError($code, null, $mode, $options, null, null, true);

        if ($userinfo === null) {
            $userinfo = $this->last_query;

        if ($nativecode) {
            $userinfo .= " [nativecode=$nativecode]";

        return PEAR::raiseError(null, $code, $mode, $options, $userinfo,
                                  'DB_Error', true);

Actual result:
return PEAR::raiseError(null, $code, $mode, $options, $userinfo,'DB_Error', true);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-19 09:43 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

This is a PEAR bug, please report it on the PEAR bug system at:
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Jun 15 09:01:23 2021 UTC