bug_37445.phpt 674 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. PDO MySQL Bug #37445 (Premature stmt object destruction)
  3. --EXTENSIONS--
  4. pdo
  5. pdo_mysql
  6. --SKIPIF--
  7. <?php
  8. require __DIR__ . '/config.inc';
  9. require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
  10. PDOTest::skip();
  11. ?>
  12. --FILE--
  13. <?php
  14. require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
  15. $db = PDOTest::test_factory(__DIR__ . '/common.phpt');
  16. $db->setAttribute(PDO :: ATTR_EMULATE_PREPARES, true);
  17. $stmt = $db->prepare("SELECT 1");
  18. $stmt->bindParam(':a', 'b');
  19. ?>
  20. --EXPECTF--
  21. Fatal error: Uncaught Error: PDOStatement::bindParam(): Argument #2 ($var) cannot be passed by reference in %sbug_37445.php:%d
  22. Stack trace:
  23. #0 {main}
  24. thrown in %sbug_37445.php on line %d