note 105010 deleted from function.is-array by danbrown

From: Date: Mon, 25 Jul 2011 12:31:40 +0000
Subject: note 105010 deleted from function.is-array by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-181843@lists.php.net to get a copy of this message
Note Submitter: xyphoid ---- 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.

« previous php.notes (#181843) next »