Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c8c2597

Browse filesBrowse files
committed
minor symfony#20523 [Yaml] Add support for dumping null as an empty value by using the Yaml::DUMP_NULL_AS_EMPTY flag (alexandre-daubois)
This PR was merged into the 7.3 branch. Discussion ---------- [Yaml] Add support for dumping `null` as an empty value by using the `Yaml::DUMP_NULL_AS_EMPTY` flag Fix symfony#20495 Commits ------- ab69163 [Yaml] Add support for dumping `null` as an empty value by using the `Yaml::DUMP_NULL_AS_EMPTY` flag
2 parents 98937bb + ab69163 commit c8c2597
Copy full SHA for c8c2597

File tree

Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed

‎components/yaml.rst

Copy file name to clipboardExpand all lines: components/yaml.rst
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,16 @@ you can dump them as ``~`` with the ``DUMP_NULL_AS_TILDE`` flag::
428428
$dumped = Yaml::dump(['foo' => null], 2, 4, Yaml::DUMP_NULL_AS_TILDE);
429429
// foo: ~
430430

431+
Another valid representation of the ``null`` value is an empty string. You can
432+
use the ``DUMP_NULL_AS_EMPTY`` flag to dump null values as empty strings::
433+
434+
$dumped = Yaml::dump(['foo' => null], 2, 4, Yaml::DUMP_NULL_AS_EMPTY);
435+
// foo:
436+
437+
.. versionadded:: 7.3
438+
439+
The ``DUMP_NULL_AS_EMPTY`` flag was introduced in Symfony 7.3.
440+
431441
Dumping Numeric Keys as Strings
432442
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
433443

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.