mysqli + xdebug breakpoint after closing statement result in many warnings

前端 未结 6 2052
生来不讨喜
生来不讨喜 2020-11-30 07:24

I have a piece of code like this:

$conn = new mysqli($host, $username, $passwd, $dbname);

...

$stmt = $conn->prepare(\'SELECT ...\');
$stmt->bind_par         


        
6条回答
  •  既然无缘
    2020-11-30 08:14

    There are some similar issues reported
    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);
    

    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.

    EDIT: Now there is also a reported issue :)

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

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

提交回复
热议问题