From:             tony at marston-home dot demon dot co dot uk
Operating system: WindowsXP
PHP version:      5.0.0
PHP Bug Type:     Unknown/Other Function
Bug description:  $errcontext no longer shows object reference

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.

-- 
Edit bug report at http://bugs.php.net/?id=29588&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29588&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29588&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29588&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29588&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29588&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29588&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29588&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29588&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29588&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29588&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29588&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29588&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29588&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29588&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29588&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29588&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29588&r=float

Reply via email to