Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Inline.php

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\Yaml

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal