setIndentation(2); // The level where you switch to inline YAML is set to PHP_INT_MAX to // ensure this does not occur. $output = $dumper->dump($input, PHP_INT_MAX, NULL, NULL, TRUE); return $output; } }