Zend\Stdlib\ArrayUtils::isHashTable
Test whether an array is a hash table.
An array is a hash table if: 1. Contains one or more non-integer keys, or 2. Integer keys are non-continuous or misaligned (not starting with 0) For example: <code> $hash = array( 'foo' => 15, 'bar' => false, ); $hash = array( 1995 => 'Birth of PHP', 2009 => 'PHP 5.3.0', 2012 => 'PHP 5.4.0', ); $hash = array( 'formElement, 'options' => array( 'debug' => true ), ); </code>
Signature
public function isHashTable(mixed
$value,
[bool
$allowEmpty = false] )
Parameters
$value
— mixed$allowEmpty
— object- Is an empty array() a valid hash table?
Returns
- bool