#25470 [Com]: HTML_QuickForm bug in setDefaults, setConstants because of array_merge

From: Date: Wed, 24 Sep 2003 11:13:52 +0000
Subject: #25470 [Com]: HTML_QuickForm bug in setDefaults, setConstants because of array_merge
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-21927@lists.php.net to get a copy of this message
ID: 25470 Comment by: f dot berger at 21torr dot com Reported By: bmansion at mamasam dot com Status: Open Bug Type: PEAR related PHP Version: 4.3.3 Assigned To: mansion New Comment: The Category should be changed and the bug should be retitled, because this is a general bug, not related to PEAR, and not related to HTML_QuickForm. Problem I have: $ar = array ('-999'=>'a',0=>'b',1=>'c'); $ar2 = array ('x'=>'x','y'=>'y','z'=>'z'); print_r(array_merge($ar,$ar2)); results in a version prior to 4.3.3 to Array ( [-999] => c [0] => b [1] => a [x] => x [y] => y [z] => z ) in version 4.3.3 to [0] => a [1] => b [2] => c [x] => x [y] => y [z] => z ) Previous Comments: ------------------------------------------------------------------------ [2003-09-10 11:53:37] bmansion at mamasam dot com Description: ------------ When the index in the array is a string like "1234567890", I mean containing only figures, array_merge will convert it to an int and change the index by resetting the value. 2 options: Make our own array_merge function. PHP Team fix array_merge so that it keep track of the index type. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25470&edit=1

« previous php.pear.dev (#21927) next »