1
0
mirror of https://github.com/php/php-src.git synced 2026-04-17 04:51:03 +02:00
Files
archived-php-src/ext/dba/tests/dba_array_keys_var_non_string.phpt
George Peter Banyard 8db5e70866 DBA should not convert elements in-place if the key param is an array
Also check that the value can actually be converted to string
2021-10-24 22:41:22 +01:00

55 lines
778 B
PHP

--TEST--
DBA check behaviour of key as an array with non string elements
--EXTENSIONS--
dba
--SKIPIF--
<?php
require_once(__DIR__ .'/skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
require_once(__DIR__ .'/test.inc');
$db_file = dba_open($db_file, "n", $handler);
if ($db_file === false) {
die('Error creating database');
}
$key = [5, 5.21];
var_dump($key);
var_dump(dba_insert($key, 'Test', $db_file));
var_dump($key);
var_dump(dba_fetch($key, $db_file));
var_dump($key);
dba_close($db_file);
?>
--CLEAN--
<?php
require(__DIR__ .'/clean.inc');
?>
--EXPECT--
array(2) {
[0]=>
int(5)
[1]=>
float(5.21)
}
bool(true)
array(2) {
[0]=>
int(5)
[1]=>
float(5.21)
}
string(4) "Test"
array(2) {
[0]=>
int(5)
[1]=>
float(5.21)
}