mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
29a96e09b2
It used the "add_new" variant which assumes the key doesn't already exist. But in case of duplicate keys we have to take the last result. Closes GH-11453.
26 lines
436 B
PHP
26 lines
436 B
PHP
--TEST--
|
|
GH-11451 (Invalid associative array containing duplicate keys)
|
|
--EXTENSIONS--
|
|
sqlite3
|
|
--FILE--
|
|
<?php
|
|
var_dump((new SQLite3(':memory:'))
|
|
->query('SELECT 1 AS key, 2 AS key')
|
|
->fetchArray(SQLITE3_ASSOC));
|
|
|
|
var_dump((new SQLite3(':memory:'))
|
|
->query('SELECT 0 AS dummy, 1 AS key, 2 AS key')
|
|
->fetchArray(SQLITE3_ASSOC));
|
|
?>
|
|
--EXPECT--
|
|
array(1) {
|
|
["key"]=>
|
|
int(2)
|
|
}
|
|
array(2) {
|
|
["dummy"]=>
|
|
int(0)
|
|
["key"]=>
|
|
int(2)
|
|
}
|