php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29588 $errcontext no longer shows object reference
Submitted: 2004-08-09 17:24 UTC Modified: 2005-03-01 09:44 UTC
From: tony at marston-home dot demon dot co dot uk Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.0.0 OS: WindowsXP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tony at marston-home dot demon dot co dot uk
New email:
PHP Version: OS:

 

 [2004-08-09 17:24 UTC] tony at marston-home dot demon dot co dot uk
Description:
------------
I have a class called 'mysql' which deals with all MySQL function calls. It contains the following code:

$result = mysqli_query($link, $query) or trigger_error("SQL", E_USER_ERROR);

In the event of a fatal error it calls my custom error handler which accesses all 5 arguments ($errno, $errstr, $errfile, $errline, $errcontext).

With PHP 4 $errcontext contains the following:
Array
(
    [this] => mysql Object
        (
            ... class variables appear here ...  
        )

    [dbname] => sample
    [tablename] => pers_opt_xref
    [where] => ...
    [result] => 
)

With PHP 5 the same error produces the following:
Array
(
    [dbname] => sample
    [tablename] => pers_opt_xref
    [where] => ...  
    [result] => 
)

You will note that the object references are completely missing. This is preventing me from determining that the error came from my 'mysql' object and therefore obtaining the current values for mysql_errno() and mysql_error().

Expected result:
----------------
If the error is triggered from within an object I expect $errcontext to contain an object reference as stated in the manual at http://www.php.net/manual/en/function.set-error-handler.php

Actual result:
--------------
If triggered from within an object $errcontext does not contain any object references.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-28 21:23 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-03-01 08:17 UTC] tony at marston-home dot demon dot co dot uk
Yes, that works now.
 [2005-03-01 09:44 UTC] tony2001@php.net
Close it then.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 06:01:28 2024 UTC