php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #55343 documentation needs to be more clear
Submitted: 2011-08-02 08:29 UTC Modified: 2011-08-02 09:34 UTC
From: bas5winkel at gmail dot com Assigned: aharvey (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: irrelevant
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bas5winkel at gmail dot com
New email:
PHP Version: OS:

 

 [2011-08-02 08:29 UTC] bas5winkel at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.array-intersect-assoc%23Description
---
Could you maybe add that entries from both arrays are matched based on their key and value pairs?
If in both arrays a certain key exists but the values are different, then it would not be considered a match.
It took me a while to figure this out.

Thanks in advance!



Test script:
---------------
Another example like this would be helpful to understand the working of the method.
<?PHP
$array1 = array(  1 => 20,  6 => 20);
$array2 = array(  1 => 6,  6 => 20);
$result_array = array_intersect_assoc($array1, $array2);
print_r($result_array);
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-02 09:23 UTC] aharvey@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: aharvey
 [2011-08-02 09:33 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=314091
Log: Fix doc bug #55343 (documentation needs to be more clear) by making the
array_intersect_assoc() example more explicit.
 [2011-08-02 09:34 UTC] aharvey@php.net
-Status: Assigned +Status: Closed
 [2011-08-02 09:34 UTC] aharvey@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 04:00:01 2026 UTC