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.
2 parents 31f9783 + 758a4b3 commit 3adc2dbCopy full SHA for 3adc2db
components/yaml.rst
@@ -375,6 +375,23 @@ objects, they are automatically transformed into YAML tags::
375
$dumped = Yaml::dump($data);
376
// $dumped = '!my_tag { foo: bar }'
377
378
+Dumping null
379
+~~~~~~~~~~~~
380
+
381
+``null`` values will be represented with ``null`` by default::
382
383
+ $dumped = Yaml::dump(array('foo' => null));
384
+ // foo: null
385
386
+You can represent them with ``~`` by using the ``DUMP_NULL_AS_TILDE`` flag::
387
388
+ $dumped = Yaml::dump(array('foo' => null), 2, 4, Yaml::DUMP_NULL_AS_TILDE);
389
+ // foo: ~
390
391
+.. versionadded:: 4.4
392
393
+ The flag to dump ``null`` as ``~`` was introduced in Symfony 4.4.
394
395
Syntax Validation
396
~~~~~~~~~~~~~~~~~
397
0 commit comments