Anyone can comment on a bug. Have a simpler test case? Does it
work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please
— but make sure to vote on the bug!

This is a memory management issue, as setting `$st = null` hints
at. Furthermore, assigning the second `$db->query()` to something
else than `$st` (e.g. `$st1`) also lets the script succeed.
The fix for PHP-7.0+ appears to be trivial (see PR #2112), but I
don't know how to solve the problem for PHP-5.6.