#24829 [Bgs]: array_intersect_assoc compares keys AND values

2003-07-27 Thread niklas at zim dot goe dot net
 ID:   24829
 User updated by:  niklas at zim dot goe dot net
 Reported By:  niklas at zim dot goe dot net
 Status:   Bogus
 Bug Type: Arrays related
 Operating System: Linux 2.4.20
 PHP Version:  4.3.1
 New Comment:

Maybe you can point this out in the documentation.


Previous Comments:


[2003-07-27 10:03:43] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The displayed behaviour is the correct one.



[2003-07-27 08:34:40] niklas at zim dot goe dot net

Description:

The function array_intersect_assoc compares keys AND values. According
to the documentation only the keys should be considered.

The documentation says:
"Note that the keys are used in the comparison unlike in
array_intersect()."

If this is the volitional behavior you should point that out in the
documentation ("... that the keys are used too ...").

Reproduce code:
---
$array1 = array ("a" => "green");
$array2 = array ("a" => "greenToo");
print_r(array_intersect_assoc ($array1, $array2));

Expected result:

Array(
  [a] => "green"
)

Actual result:
--
Array()






-- 
Edit this bug report at http://bugs.php.net/?id=24829&edit=1



#24829 [NEW]: array_intersect_assoc compares keys AND values

2003-07-27 Thread niklas at zim dot goe dot net
From: niklas at zim dot goe dot net
Operating system: Linux 2.4.20
PHP version:  4.3.1
PHP Bug Type: Arrays related
Bug description:  array_intersect_assoc compares keys AND values

Description:

The function array_intersect_assoc compares keys AND values. According to
the documentation only the keys should be considered.

The documentation says:
"Note that the keys are used in the comparison unlike in
array_intersect()."

If this is the volitional behavior you should point that out in the
documentation ("... that the keys are used too ...").

Reproduce code:
---
$array1 = array ("a" => "green");
$array2 = array ("a" => "greenToo");
print_r(array_intersect_assoc ($array1, $array2));

Expected result:

Array(
  [a] => "green"
)

Actual result:
--
Array()


-- 
Edit bug report at http://bugs.php.net/?id=24829&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=24829&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=24829&r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=24829&r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=24829&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24829&r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=24829&r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=24829&r=support
Expected behavior:  http://bugs.php.net/fix.php?id=24829&r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=24829&r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=24829&r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=24829&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24829&r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=24829&r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=24829&r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=24829&r=gnused