function Inline::isHash
Check if given array is hash or just normal indexed array.
2 calls to Inline::isHash()
- Dumper::dump in vendor/
symfony/ yaml/ Dumper.php - Dumps a PHP value to YAML.
- Inline::dumpArray in vendor/
symfony/ yaml/ Inline.php - Dumps a PHP array to a YAML string.
File
-
vendor/
symfony/ yaml/ Inline.php, line 198
Class
- Inline
- Inline implements a YAML parser/dumper for the YAML inline syntax.
Namespace
Symfony\Component\YamlCode
public static function isHash(array|\ArrayObject|\stdClass $value) : bool {
if ($value instanceof \stdClass || $value instanceof \ArrayObject) {
return true;
}
$expectedKey = 0;
foreach ($value as $key => $val) {
if ($key !== $expectedKey++) {
return true;
}
}
return false;
}