|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-05-26 15:48 UTC] cmb@php.net
-Assigned To:
+Assigned To: cmb
[2019-05-26 16:50 UTC] cmb@php.net
-Summary: dbase function may modify passed array
+Summary: dbase functions may modify passed array
[2019-05-26 16:53 UTC] cmb@php.net
[2019-05-26 16:53 UTC] cmb@php.net
-Status: Assigned
+Status: Closed
[2019-05-26 18:47 UTC] cmb@php.net
[2021-04-06 10:18 UTC] git@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 15 23:00:01 2025 UTC |
Description: ------------ dbase_create(), dbase_add_record() and dbase_replace_record() modify their array argument, albeit passed by value, if a string is expected, but a compatible type is given. Test script: --------------- <?php $def = array([17, 'C', 10]); $dbh = dbase_create('test.dbf', $def); var_dump($def); $record = [4]; dbase_add_record($dbh, $record); dbase_close($dbh); var_dump($record); ?> Expected result: ---------------- array(1) { [0]=> array(3) { [0]=> int(17) [1]=> string(1) "C" [2]=> int(10) } } array(1) { [0]=> int(4) } Actual result: -------------- array(1) { [0]=> array(3) { [0]=> string(2) "17" [1]=> string(1) "C" [2]=> int(10) } } array(1) { [0]=> string(1) "4" }