#19006 [Opn]: Test failure orange/banana

From: Date: Wed, 21 Aug 2002 07:46:55 +0000
Subject: #19006 [Opn]: Test failure orange/banana
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17417@lists.php.net to get a copy of this message
ID: 19006 User updated by: msopacua@idg.nl Reported By: msopacua@idg.nl Status: Open Bug Type: Arrays related Operating System: BSD/OS PHP Version: 4CVS-2002-08-20 New Comment: 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" } } Previous Comments: ------------------------------------------------------------------------ [2002-08-21 03:34:53] msopacua@idg.nl Ok, strike that last one. With sdiff, it became clearer. Seems that the problem is in array_sum rather than the ua* functions. I'll look into it. ------------------------------------------------------------------------ [2002-08-21 02:55:26] msopacua@idg.nl Yes. This one always fails. Since the output is quite lengthly and generated by multiple array functions, it's hard to pin down the actual problem. So, IMO the test should be split into three seperate tests for the respective functions and then this one. Maybe it is the combination of the functions, maybe it's print_r, maybe it's one seperate one. No way to tell now. ------------------------------------------------------------------------ [2002-08-20 21:45:39] sniper@php.net Can you explain this a bit?? What's the problem? Was this one of those tests that has failed always? ------------------------------------------------------------------------ [2002-08-20 19:13:14] msopacua@idg.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) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19006&edit=1

« previous php.bugs (#17417) next »