Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.6.0a3

Bug #9983 Function [array_udiff_uassoc()] is incorrectly implemented
Submitted: 2007-01-30 23:01 UTC
From: teague dot costas at amd dot com Assigned: arpad
Status: Closed Package: PHP_Compat (version 1.5.0)
PHP Version: 4.3.9 OS: Linux
Roadmaps: 1.6.0a1    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 12 + 3 = ?

 
 [2007-01-30 23:01 UTC] teague dot costas at amd dot com (Teague Costas)
Description: ------------ The function [ array_udiff_uassoc() ] is incorrectly implemented. That is, it's the wrong function. The code is identical to the code for [ array_udiff_assoc() ] (note the missing "u"), which is a different function. The PHP documentation will reveal the major difference--namely, that the [ uassoc ] version takes *two* callbacks: one for keys, one for values. PHP_Compat's version, however, takes only one--which is incorrect. The given code (it's only one line) will cause the function to generate an "Argument #3 is not an array" error. (If the function [ compareArrayKeys() ] doesn't exist Test script: --------------- function compareArrayKeys($a, $b) { return 0; } function compareArrayValues($a, $b) { return 0; } array_udiff_uassoc(array(), array(), 'compareArrayValues', 'compareArrayKeys'); Expected result: ---------------- I expected to not get any warnings, and I expected the function to implement PHP5's [ array_udiff_uassoc() ]. Actual result: -------------- Warning: array_udiff_uassoc() Argument #3 is not an array in /<...>/include/php/pear/PHP/Compat/Function/array_udiff_uassoc.php on line 56

Comments

 [2007-04-06 17:27 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!