bug70221.phpt 562 B

12345678910111213141516171819202122
  1. --TEST--
  2. Bug #70221 (persistent sqlite connection + custom function segfaults)
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
  6. ?>
  7. --FILE--
  8. <?php
  9. $dbfile = __DIR__ . '/test.sqlite';
  10. $db = new PDO('sqlite:'.$dbfile, null, null, array(PDO::ATTR_PERSISTENT => true));
  11. function _test() { return 42; }
  12. $db->sqliteCreateFunction('test', '_test', 0);
  13. print("Everything is fine, no exceptions here\n");
  14. unset($db);
  15. ?>
  16. --CLEAN--
  17. <?php
  18. $dbfile = __DIR__ . '/test.sqlite';
  19. unlink($dbfile);
  20. ?>
  21. --EXPECT--
  22. Everything is fine, no exceptions here