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