xref: /PHP-8.2/ext/pdo_mysql/tests/bug70389.phpt (revision b5a14e6c)
1--TEST--
2Bug #70389 (PDO constructor changes unrelated variables)
3--EXTENSIONS--
4pdo_mysql
5--SKIPIF--
6<?php
7require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
8MySQLPDOTest::skip();
9?>
10--FILE--
11<?php
12require(__DIR__. DIRECTORY_SEPARATOR . 'config.inc');
13$flags = [
14    PDO::MYSQL_ATTR_FOUND_ROWS	=> true,
15    PDO::MYSQL_ATTR_LOCAL_INFILE	=> true,
16    PDO::ATTR_PERSISTENT 		=> true,
17];
18
19$std = new StdClass();
20$std->flags = $flags;
21
22new PDO(PDO_MYSQL_TEST_DSN, PDO_MYSQL_TEST_USER, PDO_MYSQL_TEST_PASS, $flags);
23var_dump($flags);
24
25?>
26--EXPECTF--
27array(3) {
28  [%d]=>
29  bool(true)
30  [%d]=>
31  bool(true)
32  [%d]=>
33  bool(true)
34}
35