|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-08-11 08:19 UTC] laruence@php.net
-Status: Open
+Status: Not a bug
[2012-08-11 08:19 UTC] laruence@php.net
[2012-08-14 16:01 UTC] burakg at torreycommerce dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 18:00:01 2025 UTC |
Description: ------------ Calling print_r(debug_backtrace()) from a method of a class that inherits from mysqli overwrites the error member variable. Calling debug_backtrace() on its own doesn't seem to cause any problems, but when combined with print_r, this problem results. Test script: --------------- <?php class Db extends mysqli { function f() { $this->query("select"); var_dump($this->error); print_r(debug_backtrace(), true); var_dump($this->error); } } $db = new Db("host", "user", "password", "database"); $db->f(); Expected result: ---------------- string(146) "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1" string(146) "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1" Actual result: -------------- string(146) "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1" string(0) ""