note 129830 added to function.array-is-list
| From: | 2317216477@qq.com | Date: | Fri, 01 Nov 2024 09:30:52 +0000 |
| Subject: | note 129830 added to function.array-is-list | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221623@lists.php.net to get a copy of this message | ||
function isIndexed($array)
{
if (is_array($array)) {
$keys = array_keys($array);
return $keys === array_keys($keys);
}
return false;
}
function isAssoc($array)
{
if (is_array($array)) {
$keys = array_keys($array);
return $keys !== array_keys($keys);
}
return false;
}
these two function is more faster than divinity76+spam at gmail dot com's about three times in
my computer for PHP 8.2.9:
array(3) {
["pre"]=>
float(0.8179779052734375)
["post"]=>
float(0.8116860389709473)
["index"]=>
float(0.3369460105895996)
}
:)
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 61.180.76.197)
----
Manual Page -- https://php.net/manual/en/function.array-is-list.php
Edit -- https://main.php.net/note/edit/129830
Del: integrated -- https://main.php.net/note/delete/129830/integrated
Del: useless -- https://main.php.net/note/delete/129830/useless
Del: bad code -- https://main.php.net/note/delete/129830/bad+code
Del: spam -- https://main.php.net/note/delete/129830/spam
Del: non-english -- https://main.php.net/note/delete/129830/non-english
Del: in docs -- https://main.php.net/note/delete/129830/in+docs
Del: other reasons-- https://main.php.net/note/delete/129830
Reject -- https://main.php.net/note/reject/129830
Search -- https://main.php.net/manage/user-notes.php