I have a piece of code like this:
$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.
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
Property access is not allowed yet
or
Couldn't fetch mysqli_stmt
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?
Update: This problem still exist in PHP 7.0.1 / Xdebug 2.4.0 RC3.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…