YaLinqo\Enumerable::toArrayDeep PHP Method

toArrayDeep() public method

Syntax: toArrayDeep ()

The toArrayDeep method forces immediate query evaluation and returns an array that contains the query results.

The toArrayDeep method traverses into elements of the sequence. That is, if elements of the sequence are {@link Traversable} or arrays containing Traversable values, they will be converted to arrays too. To convert only the sequence itself, you can use {@link toArray} method.

Keys from the sequence are preserved. If the source sequence contains multiple values with the same key, the result array will only contain the latter value. To discard keys, you can use {@link toListDeep} method. To preserve all values and keys, you can use {@link toLookup} method.

public toArrayDeep ( ) : array
return array An array that contains the elements from the input sequence.
    public function toArrayDeep()
    {
        return $this->toArrayDeepProc($this);
    }

Usage Example

 /**
  * {@inheritdoc}
  * @param Enumerable $actual
  */
 public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE, array &$processed = array())
 {
     parent::assertEquals($expected, $actual->toArrayDeep(), $delta, $canonicalize, $ignoreCase, $processed);
 }