note 105010 added to function.is-array
| From: | xyphoid at osu1 dot php dot net | Date: | Fri, 22 Jul 2011 03:26:42 +0000 |
| Subject: | note 105010 added to function.is-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-181772@lists.php.net to get a copy of this message | ||
Note that these 'is_assoc' functions don't actually work, so their benchmark
performances probably aren't relevant.
--
function is_assoc($arr) { return ((array) $arr !== $arr); }
$array1 = array("a",1,3,"fish",7);
$array2 = array(0,1,2,3,4,5);
var_dump(is_assoc($array1));
var_dump(is_assoc($array2));
--
produces
bool(false) bool(false) in 5.3.
----
Server IP: 69.147.83.197
Probable Submitter: 111.69.28.210
----
Manual Page -- http://www.php.net/manual/en/function.is-array.php
Edit -- https://master.php.net/note/edit/105010
Del: integrated -- https://master.php.net/note/delete/105010/integrated
Del: useless -- https://master.php.net/note/delete/105010/useless
Del: bad code -- https://master.php.net/note/delete/105010/bad+code
Del: spam -- https://master.php.net/note/delete/105010/spam
Del: non-english -- https://master.php.net/note/delete/105010/non-english
Del: in docs -- https://master.php.net/note/delete/105010/in+docs
Del: other reasons-- https://master.php.net/note/delete/105010
Reject -- https://master.php.net/note/reject/105010
Search -- https://master.php.net/manage/user-notes.php