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