|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-01-30 11:29 UTC] johannes@php.net
[2012-01-30 11:29 UTC] johannes@php.net
-Status: Open
+Status: Not a bug
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 25 20:00:01 2025 UTC |
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" }