bug66550.phpt 591 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Bug #66550 (SQLite prepared statement use-after-free)
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded('sqlite3')) die('skip');
  6. ?>
  7. --FILE--
  8. <?php
  9. $db = new SQLite3(':memory:');
  10. $db->exec('CREATE TABLE foo (id INTEGER, bar STRING)');
  11. $stmt = $db->prepare('SELECT bar FROM foo WHERE id=:id');
  12. // Close the database connection and free the internal sqlite3_stmt object
  13. $db->close();
  14. // Access the sqlite3_stmt object via the php_sqlite3_stmt container
  15. $stmt->reset();
  16. ?>
  17. ==DONE==
  18. --EXPECTF--
  19. Warning: SQLite3Stmt::reset(): The SQLite3 object has not been correctly initialised in %s
  20. ==DONE==