|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-02-28 21:23 UTC] sniper@php.net
[2005-03-01 08:17 UTC] tony at marston-home dot demon dot co dot uk
[2005-03-01 09:44 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 09 01:00:01 2025 UTC |
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.