Doc #55571 [Opn->Csd]: code in is_array user note is misleading

From: Date: Fri, 02 Sep 2011 15:12:07 +0000
Subject: Doc #55571 [Opn->Csd]: code in is_array user note is misleading
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7114@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55571&edit=1 ID: 55571 Updated by: nikic@php.net Reported by: scribles at scribles dot com -Summary: code in user note is misleading +Summary: code in is_array user note is misleading -Status: Open +Status: Closed Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant -Assigned To: +Assigned To: nikic Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2011-09-02 01:25:38] 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=55571&edit=1

« previous php.doc.bugs (#7114) next »