xref: /PHP-8.0/ext/dba/tests/dba_db4_011.phpt (revision 26dfce7f)
1--TEST--
2DBA DB4 with repeated key
3--SKIPIF--
4<?php
5$handler = "db4";
6require_once(__DIR__ .'/skipif.inc');
7die("info $HND handler used");
8?>
9--FILE--
10<?php
11$handler = "db4";
12require_once(__DIR__ .'/test.inc');
13echo "database handler: $handler\n";
14if (($db_file=dba_open($db_filename, "c", $handler))!==FALSE) {
15    var_dump(dba_insert("key1", "Content String 1", $db_file));
16    var_dump(dba_insert("key2", "Content String 2", $db_file));
17    var_dump(dba_insert("key2", "Same key", $db_file));
18    echo dba_fetch("key1", $db_file), "\n";
19    echo dba_fetch("key2", $db_file), "\n";
20    dba_close($db_file);
21} else {
22    echo "Error creating database\n";
23}
24
25?>
26--CLEAN--
27<?php
28require(__DIR__ .'/clean.inc');
29?>
30--EXPECT--
31database handler: db4
32bool(true)
33bool(true)
34bool(false)
35Content String 1
36Content String 2
37