php-src/ext/dba/tests/bug65708.phpt
Adam Harvey 30e0442c54 Copy dba_*() keys before converting to string.
A nice Sunday afternoon project for somebody would be to refactor the dba
functions to use zend_parse_parameters() reliably and try to untangle some of
the macros in dba.c. Sadly, it is not a nice Sunday afternoon here.

Fixes bug #65708 (dba functions cast $key param to string in-place, bypassing
copy on write).
2013-09-22 16:46:17 -07:00

39 lines
571 B
PHP

--TEST--
Bug #65708 (dba functions cast $key param to string in-place, bypassing copy on write)
--SKIPIF--
<?php
require_once(dirname(__FILE__) .'/skipif.inc');
?>
--FILE--
<?php
error_reporting(E_ALL);
require_once(dirname(__FILE__) .'/test.inc');
$db = dba_popen($db_filename, 'c');
$key = 1;
$copy = $key;
echo gettype($key)."\n";
echo gettype($copy)."\n";
dba_exists($key, $db);
echo gettype($key)."\n";
echo gettype($copy)."\n";
dba_close($db);
?>
--CLEAN--
<?php
require(dirname(__FILE__) .'/clean.inc');
?>
--EXPECT--
integer
integer
integer
integer