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