Bug #60932 [NEW]: array_diff_assoc not working as expected.
| From: | rupertrutland at gmail dot com | Date: | Mon, 30 Jan 2012 07:06:50 +0000 |
| Subject: | Bug #60932 [NEW]: array_diff_assoc not working as expected. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-166949@lists.php.net to get a copy of this message | ||
From:
Operating system: MAC OSX 10.6.8
PHP version: 5.3.9
Package: *General Issues
Bug Type: Bug
Bug description:array_diff_assoc not working as expected.
Description:
------------
The first key/value pair should, in theory, not be present in the result
array.
Test script:
---------------
$arrayAssoc1 = array(
'one' => '1: some val',
'two' => '1: another val',
'three' => '1: and another val',
'four' => '1: fourth val',
'five' => '1: fifth val',
'six' => '1: sixth param',
'seven' => '1: sixth param',
'starwars' => '2: lightsaber'
);
$arrayAssoc2 = array(
'one' => '1: some val',
'two' => '1: another val',
'three' => '1: and another val',
'one' => '2: some val',
'five' => '1: fifth val',
'three' => '2: and another val',
'seven' => '2: and another val',
'starwars' => '2: lightsaber'
);
var_dump(array_diff_assoc($arrayAssoc1, $arrayAssoc2));
Expected result:
----------------
array(5) {
["three"] => string(18) "1: and another val"
["four"] => string(13) "1: fourth val"
["six"] => string(14) "1: sixth param"
["seven"] => string(14) "1: sixth param"
}
Actual result:
--------------
array(5) {
["one"] => string(11) "1: some val"
["three"] => string(18) "1: and another val"
["four"] => string(13) "1: fourth val"
["six"] => string(14) "1: sixth param"
["seven"] => string(14) "1: sixth param"
}
--
Edit bug report at https://bugs.php.net/bug.php?id=60932&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60932&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60932&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60932&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=60932&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60932&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=60932&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=60932&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=60932&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=60932&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=60932&r=support
Expected behavior: https://bugs.php.net/fix.php?id=60932&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=60932&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=60932&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=60932&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60932&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=60932&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=60932&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=60932&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=60932&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=60932&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=60932&r=mysqlcfg