Doc #63787 [Opn->Nab]: Array_unique notice (array to string conversion)
| From: | googleguy@php.net | Date: | Wed, 16 Jan 2013 15:10:40 +0000 |
| Subject: | Doc #63787 [Opn->Nab]: Array_unique notice (array to string conversion) | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-9425@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63787&edit=1
ID: 63787
Updated by: googleguy@php.net
Reported by: enumag at gmail dot com
Summary: Array_unique notice (array to string conversion)
-Status: Open
+Status: Not a bug
Type: Documentation Problem
Package: Arrays related
Operating System: any
PHP Version: 5.4.9
Block user comment: N
Private report: N
New Comment:
This is already mentioned in the documentation under http://us1.php.net/array-
unique#refsect1-function.array-unique-notes
See note for:
"Note: Note that array_unique() is not intended to work on multi dimensional
arrays."
Previous Comments:
------------------------------------------------------------------------
[2012-12-17 12:04:41] enumag at gmail dot com
Description:
------------
If array_unique gets an array of arrays as it's parameter and a custom $sort_flag is not
provided, it throws this error (array to string conversion). The reason is obvious, any value is
changed to a string and then compared. The problem is that it took me quite some time to figure it
out and a less experienced programmer is totally clueless.
Not sure if this can be fixed in PHP without BC break but at the very least it could be mentioned in
documentation of array_unique function.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63787&edit=1