From: gary_whittles at hotmail dot com Operating system: Fedora 17 PHP version: 5.5Git-2013-09-19 (Git) Package: DBM/DBA related Bug Type: Bug Bug description:dba functions cast $key param to string in-place, bypassing copy on write
Description:
------------
Calling dba functions (e.g. dba_exists/dba_insert) with a non-string key
causes
the key to be cast to a string. This also affects any variables that are
copies
of the key variable.
This seems to be independent of database type - tested with db4 and
flatfile
databases.
Test script:
---------------
<?php
$db = dba_open('/tmp/testdb', 'c', 'flatfile');
$i = 1; //use integer key
$j = $i; //copy by value
echo gettype($i)."\n";
echo gettype($j)."\n";
dba_exists($i, $db);
echo gettype($i)."\n";
echo gettype($j)."\n";
Expected result:
----------------
integer
integer
integer
integer
Actual result:
--------------
integer
integer
string
string
--
Edit bug report at https://bugs.php.net/bug.php?id=65708&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=65708&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=65708&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=65708&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=65708&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=65708&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65708&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=65708&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=65708&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=65708&r=support
Expected behavior: https://bugs.php.net/fix.php?id=65708&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=65708&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=65708&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=65708&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65708&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=65708&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=65708&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=65708&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65708&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65708&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=65708&r=mysqlcfg
