• <tfoot id='UfO8P'></tfoot>
  • <legend id='UfO8P'><style id='UfO8P'><dir id='UfO8P'><q id='UfO8P'></q></dir></style></legend>

      1. <i id='UfO8P'><tr id='UfO8P'><dt id='UfO8P'><q id='UfO8P'><span id='UfO8P'><b id='UfO8P'><form id='UfO8P'><ins id='UfO8P'></ins><ul id='UfO8P'></ul><sub id='UfO8P'></sub></form><legend id='UfO8P'></legend><bdo id='UfO8P'><pre id='UfO8P'><center id='UfO8P'></center></pre></bdo></b><th id='UfO8P'></th></span></q></dt></tr></i><div id='UfO8P'><tfoot id='UfO8P'></tfoot><dl id='UfO8P'><fieldset id='UfO8P'></fieldset></dl></div>
          <bdo id='UfO8P'></bdo><ul id='UfO8P'></ul>

        <small id='UfO8P'></small><noframes id='UfO8P'>

        mysqli + xdebug 断点后关闭语句导致很多警告

        时间:2023-07-31
        • <legend id='NQ1io'><style id='NQ1io'><dir id='NQ1io'><q id='NQ1io'></q></dir></style></legend>
          • <small id='NQ1io'></small><noframes id='NQ1io'>

              <tbody id='NQ1io'></tbody>
              • <bdo id='NQ1io'></bdo><ul id='NQ1io'></ul>
                <i id='NQ1io'><tr id='NQ1io'><dt id='NQ1io'><q id='NQ1io'><span id='NQ1io'><b id='NQ1io'><form id='NQ1io'><ins id='NQ1io'></ins><ul id='NQ1io'></ul><sub id='NQ1io'></sub></form><legend id='NQ1io'></legend><bdo id='NQ1io'><pre id='NQ1io'><center id='NQ1io'></center></pre></bdo></b><th id='NQ1io'></th></span></q></dt></tr></i><div id='NQ1io'><tfoot id='NQ1io'></tfoot><dl id='NQ1io'><fieldset id='NQ1io'></fieldset></dl></div>

                  <tfoot id='NQ1io'></tfoot>

                  本文介绍了mysqli + xdebug 断点后关闭语句导致很多警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我有一段这样的代码:

                  $conn = new mysqli($host, $username, $passwd, $dbname);
                  
                  ...
                  
                  $stmt = $conn->prepare('SELECT ...');
                  $stmt->bind_param(...);
                  $stmt->execute();
                  $stmt->bind_result(...);
                  while($stmt->fetch())
                  {
                      // do something here
                  }
                  $stmt->close();
                  
                  ...
                  
                  // do something more here that has absolutely nothing to do with $stmt
                  

                  这很好用.我得到了预期的结果,没有错误或任何不应该发生的事情.

                  This works perfectly fine. I get the results I expected, there are no errors or anything that is not supposed to happen.

                  但是如果我将断点(Xdebug 2.2.5/2.2.6/2.2.8/2.3.2 和 PHP 5.5.3/5.5.15/5.6.0/5.6.6/5.6.10)设置为一行之后 $stmt->close();,我收到很多警告,比如

                  But if I set a break point (Xdebug 2.2.5 / 2.2.6 / 2.2.8 / 2.3.2 and PHP 5.5.3 / 5.5.15 / 5.6.0 / 5.6.6 / 5.6.10) to a line after $stmt->close();, I get many warnings like

                  尚未允许访问属性

                  无法获取 mysqli_stmt

                  Couldn't fetch mysqli_stmt

                  我以为我错过了关闭另一个 mysqli 语句,但我得到了所有结果.我的代码似乎没有问题...

                  I thought I missed to close another mysqli statement, but I get all results. There seems to be just no problem in my code...

                  有没有办法摆脱这种错误警告?

                  Is there a way to get rid of this wrong warnings?

                  更新:这个问题在 PHP 7.0.1/Xdebug 2.4.0 RC3 中仍然存在.

                  Update: This problem still exist in PHP 7.0.1 / Xdebug 2.4.0 RC3.

                  推荐答案

                  有一些类似的问题报告
                  http://bugs.xdebug.org/view.php?id=900
                  https://bugs.php.net/bug.php?id=60778

                  摆脱此消息的一种方法是添加

                  One way to get rid of this messages is to add

                  unset($stmt);
                  

                  在关闭语句之后和断点之前.如果这没有帮助,您还应该添加

                  after closing the statement and before the breakpoint. If this does not help, you should also add

                  unset($connection);
                  

                  在@Martin 在评论中提到关闭连接之后.

                  after closing the connection as mentioned by @Martin in the comments.

                  这本身并不能解决问题,而是让您继续工作,直到这可能会在一段时间内得到解决.

                  This does not solve the problem itself, but let you go on with your work until this may be fixed some time.

                  编辑:现在还有一个报告的问题 :)

                  编辑:据报道,这似乎是 MySQLi 驱动程序中的一个错误 此处.

                  EDIT: This seems to be a bug in the MySQLi driver as reported here.

                  EDIT:如果您使用 PDO,看起来这个错误不会出现.所以这可能是切换到 PDO 的另一个原因.

                  EDIT: Looks like this bug does not appear if you use PDO. So this is maybe an other reason to switch to PDO.

                  这篇关于mysqli + xdebug 断点后关闭语句导致很多警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:函数中的 Mysqli 查询 - PHP 下一篇:Mysqli fetch_assoc 与 fetch_array

                  相关文章

                  最新文章

                  <tfoot id='JhsY1'></tfoot>
                1. <small id='JhsY1'></small><noframes id='JhsY1'>

                    <legend id='JhsY1'><style id='JhsY1'><dir id='JhsY1'><q id='JhsY1'></q></dir></style></legend>

                      <bdo id='JhsY1'></bdo><ul id='JhsY1'></ul>
                    1. <i id='JhsY1'><tr id='JhsY1'><dt id='JhsY1'><q id='JhsY1'><span id='JhsY1'><b id='JhsY1'><form id='JhsY1'><ins id='JhsY1'></ins><ul id='JhsY1'></ul><sub id='JhsY1'></sub></form><legend id='JhsY1'></legend><bdo id='JhsY1'><pre id='JhsY1'><center id='JhsY1'></center></pre></bdo></b><th id='JhsY1'></th></span></q></dt></tr></i><div id='JhsY1'><tfoot id='JhsY1'></tfoot><dl id='JhsY1'><fieldset id='JhsY1'></fieldset></dl></div>