1--TEST-- 2Bug #70825 (Cannot fetch multiple values with group in ini file) 3--SKIPIF-- 4<?php 5if (!extension_loaded('dba')) die('skip dba extension not available'); 6if (!in_array('inifile', dba_handlers())) die('skip inifile handler not available'); 7?> 8--FILE-- 9<?php 10$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug70825.ini'; 11 12$db = dba_open($filename, 'n', 'inifile'); 13dba_insert('foo', 23, $db); 14dba_insert('foo', 42, $db); 15dba_insert('foo', 1337, $db); 16var_dump(dba_fetch('foo', -1, $db)); 17var_dump(dba_fetch('foo', -1, $db)); 18var_dump(dba_fetch('foo', -1, $db)); 19dba_close($db); 20unlink($filename); 21 22$db = dba_open($filename, 'n', 'inifile'); 23dba_insert(['foo', 'bar'], 23, $db); 24dba_insert(['foo', 'bar'], 42, $db); 25dba_insert(['foo', 'bar'], 1337, $db); 26var_dump(dba_fetch(['foo', 'bar'], -1, $db)); 27var_dump(dba_fetch(['foo', 'bar'], -1, $db)); 28var_dump(dba_fetch(['foo', 'bar'], -1, $db)); 29dba_close($db); 30unlink($filename); 31 32$db = dba_open($filename, 'n', 'inifile'); 33dba_insert('[foo]bar', 23, $db); 34dba_insert('[foo]bar', 42, $db); 35dba_insert('[foo]bar', 1337, $db); 36var_dump(dba_fetch('[foo]bar', -1, $db)); 37var_dump(dba_fetch('[foo]bar', -1, $db)); 38var_dump(dba_fetch('[foo]bar', -1, $db)); 39dba_close($db); 40unlink($filename); 41 42$db = dba_open($filename, 'n', 'inifile'); 43dba_insert('[foo]bar', 23, $db); 44dba_insert('[foo]bar', 42, $db); 45dba_insert('[foo]bar', 1337, $db); 46var_dump(dba_fetch('[foo]bar', 0, $db)); 47var_dump(dba_fetch('[foo]bar', 1, $db)); 48var_dump(dba_fetch('[foo]bar', 2, $db)); 49dba_close($db); 50unlink($filename); 51?> 52--EXPECT-- 53string(2) "23" 54string(2) "42" 55string(4) "1337" 56string(2) "23" 57string(2) "42" 58string(4) "1337" 59string(2) "23" 60string(2) "42" 61string(4) "1337" 62string(2) "23" 63string(2) "42" 64string(4) "1337" 65--CLEAN-- 66<?php 67$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug70825.ini'; 68unlink($filename); 69?> 70