php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #55571 code in is_array user note is misleading
Submitted: 2011-09-02 01:25 UTC Modified: 2011-09-02 15:12 UTC
From: scribles at scribles dot com Assigned: nikic (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
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: scribles at scribles dot com
New email:
PHP Version: OS:

 

 [2011-09-02 01:25 UTC] scribles at scribles dot com
Description:
------------
---
From manual page: http://www.php.net/function.is-array
---

misleading 
The post by Xunnamius@DarkGray on 27-Jun-2011 06:31 is confusing testing for an 
array and testing for an associative array. I spent way too much time trying to 
figure out how "return ((array) $arr !== $arr);" could possible test for an 
associative array before I realized it just tests for any array. The name of the 
functions (is_assoc_3 and is_assoc_4) and the context of comparing them to 
functions that do test for associative arrays make it appear that the functions 
do something other than what they do.

I was going to post a note explaining this so someone else wouldn't waste their 
time, but I didn't want to add more clutter to the notes.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-02 15:12 UTC] nikic@php.net
-Summary: code in user note is misleading +Summary: code in is_array user note is misleading -Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2011-09-02 15:12 UTC] nikic@php.net
I deleted that note, as it was indeed quite misleading and the non-misleading benchmarks are already present in other notes. Thanks for your efforts.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 15:00:02 2026 UTC