xref: /PHP-8.2/ext/sqlite3/tests/gh11451.phpt (revision 29a96e09)
1--TEST--
2GH-11451 (Invalid associative array containing duplicate keys)
3--EXTENSIONS--
4sqlite3
5--FILE--
6<?php
7var_dump((new SQLite3(':memory:'))
8	->query('SELECT 1 AS key, 2 AS key')
9	->fetchArray(SQLITE3_ASSOC));
10
11var_dump((new SQLite3(':memory:'))
12	->query('SELECT 0 AS dummy, 1 AS key, 2 AS key')
13	->fetchArray(SQLITE3_ASSOC));
14?>
15--EXPECT--
16array(1) {
17  ["key"]=>
18  int(2)
19}
20array(2) {
21  ["dummy"]=>
22  int(0)
23  ["key"]=>
24  int(2)
25}
26