private static function flatten(array $array, &$output): void
    {
        if (null === $output) {
            $output = [];
        }

        foreach ($array as $key => $value) {
            if (\is_array($value)) {
                self::flatten($value, $output);

                continue;
            }

            $output[$key] = $value;
        }
    }
private static function flatten(array $array, &$output): void
    {
        if (null === $output) {
            $output = [];
        }

        foreach ($array as $key => $value) {
            if (\is_array($value)) {
                self::flatten($value, $output);

                continue;
            }

            $output[$key] = $value;
        }
    }
private static function flatten ( array $ array , & $ output ) : void { if ( null === $ output ) { $ output = [ ] ; } foreach ( $ array as $ key => $ value ) { if ( \ is_array ( $ value ) ) { self :: flatten ( $ value , $ output ) ; continue ; } $ output [ $ key ] = $ value ; } }
Flattens an array into the given output variable.

@param array      $array  The array to flatten
@param array|null $output The flattened output
Flattens an array into the given output variable .