#19006 [Csd]: Test failure orange/banana
| From: | msopacua at idg dot nl | Date: | Wed, 21 Aug 2002 11:44:10 +0000 |
| Subject: | #19006 [Csd]: Test failure orange/banana | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-17432@lists.php.net to get a copy of this message | ||
ID: 19006
User updated by: msopacua@idg.nl
Reported By: msopacua@idg.nl
Status: Closed
Bug Type: Arrays related
Operating System: BSD/OS
PHP Version: 4CVS-2002-08-20
New Comment:
Helly,
could you also commit to PHP_4_2_0 branch?
Previous Comments:
------------------------------------------------------------------------
[2002-08-21 06:43:55] helly@php.net
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2002-08-21 03:50:09] msopacua@idg.nl
Sorry for the screwed output,
the expected output, expects an int(0) (the result of array_sum). But
since array_sum no longer changes the actual array, the array remains
in tact as 'string[6] => banana'.
------------------------------------------------------------------------
[2002-08-21 03:46:54] msopacua@idg.nl
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"
} }
------------------------------------------------------------------------
[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.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/19006
--
Edit this bug report at http://bugs.php.net/?id=19006&edit=1