Exports a Collection instance to an array. Used by Collection::to().
public static toArray ( mixed $data, array $options = [] ) : array | ||
$data | mixed | Either a `Collection` instance, or an array representing a `Collection`'s internal state. |
$options | array | Options used when converting `$data` to an array: - `'handlers'` _array_: An array where the keys are fully-namespaced class names, and the values are closures that take an instance of the class as a parameter, and return an array or scalar value that the instance represents. |
Résultat | array | Returns the value of `$data` as a pure PHP array, recursively converting all sub-objects and other values to their closest array or scalar equivalents. |