[PHP-DEV] PHP 4.0 Bug #9319 Updated: join function joins in reverse order in one specific instance.

2001-02-25 Thread jmoore

ID: 9319
Updated by: jmoore
Reported By: [EMAIL PROTECTED]
Old-Status: Analyzed
Status: Closed
Bug Type: Arrays related
Assigned To: 
Comments:

This is the expected behaviour and wont be changed anytime soon due to breaking too 
many scripts if we do. Please use ksort() if you really need to do this.

James

Previous Comments:
---

[2001-02-24 14:08:15] [EMAIL PROTECTED]
Verified under win2k 4.0.5-dev

This might be the expected behaviour but it is also undesirable. I cant think of a 
nice way of implmenting a fix due to the fact adding a sort to sort the keys will 
break lots of peoples scripts. Perhaps just tell the end user to ksort first although 
I feel arrays with numeric keys should probably join them in order?

James


---

[2001-02-17 12:02:51] [EMAIL PROTECTED]
$arr1 = array("dog","cat","bird","fish");
echo join(" = ",$arr1);

echo "";

$arr2[0] = "dog";
$arr2[1] = "cat";
$arr2[2] = "bird";
$arr2[3] = "fish";
echo join(" = ",$arr2);

echo "";

list($arr3[0],$arr3[1],$arr3[2],$arr3[3]) = array("dog","cat","bird","fish");
echo join(" = ",$arr3);

// This last join will join in the reverse order.

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9319&edit=2


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #9319 Updated: join function joins in reverse order in one specific instance.

2001-02-24 Thread jmoore

ID: 9319
Updated by: jmoore
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Analyzed
Bug Type: Arrays related
Assigned To: 
Comments:

Verified under win2k 4.0.5-dev

This might be the expected behaviour but it is also undesirable. I cant think of a 
nice way of implmenting a fix due to the fact adding a sort to sort the keys will 
break lots of peoples scripts. Perhaps just tell the end user to ksort first although 
I feel arrays with numeric keys should probably join them in order?

James


Previous Comments:
---

[2001-02-17 12:02:51] [EMAIL PROTECTED]
$arr1 = array("dog","cat","bird","fish");
echo join(" = ",$arr1);

echo "";

$arr2[0] = "dog";
$arr2[1] = "cat";
$arr2[2] = "bird";
$arr2[3] = "fish";
echo join(" = ",$arr2);

echo "";

list($arr3[0],$arr3[1],$arr3[2],$arr3[3]) = array("dog","cat","bird","fish");
echo join(" = ",$arr3);

// This last join will join in the reverse order.

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9319&edit=2


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]