We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
null
Yaml::DUMP_NULL_AS_EMPTY
1 parent 2ccc964 commit ab69163Copy full SHA for ab69163
components/yaml.rst
@@ -428,6 +428,16 @@ you can dump them as ``~`` with the ``DUMP_NULL_AS_TILDE`` flag::
428
$dumped = Yaml::dump(['foo' => null], 2, 4, Yaml::DUMP_NULL_AS_TILDE);
429
// foo: ~
430
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
441
Dumping Numeric Keys as Strings
442
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
443
0 commit comments