|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-08-20 19:13 UTC] msopacua at idg dot nl
STABLE cvs:
--- ./ext/standard/tests/array/003.exp Wed Aug 21 00:20:56 2002
+++ ./ext/standard/tests/array/003.out Wed Aug 21 00:20:56 2002
@@ -5,9 +5,9 @@
["-2147483648"]=>
array(2) {
[0]=>
- int(0)
+ string(6) "banana"
[1]=>
- int(0)
+ string(6) "orange"
}
["test"]=>
int(27)
@@ -26,9 +26,9 @@
["-2147483648"]=>
array(2) {
[0]=>
- int(0)
+ string(6) "banana"
[1]=>
- int(0)
+ string(6) "orange"
}
[-2147483648]=>
float(-0.33333333333333)
@@ -51,9 +51,9 @@
[1]=>
array(2) {
[0]=>
- int(0)
+ string(6) "banana"
[1]=>
- int(0)
+ string(6) "orange"
}
[2]=>
int(27)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 18:00:01 2025 UTC |
Ok - got it, see the note for array_sum in the manual: " PHP versions prior to 4.0.6 modified the passed array itself and converted strings to numbers (which most of the time converted them to zero, depending on their value)." The expected output, is expecting exactly that: -- Testing uasort() -- -- Testing uasort() -- array(7) { array(7) { [-2147483648]=> [-2147483648]=> float(-0.33333333333333) float(-0.33333333333333) ["-2147483648"]=> ["-2147483648"]=> array(2) { array(2) { [0]=> [0]=> int(0) | string(6) "banana" [1]=> [1]=> int(0) | string(6) "orange" } }