From ea71f5a56336737c6b6b26884a34f54cf900967d Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 5 Aug 2019 13:45:40 +0200 Subject: [PATCH] [Yaml] Tweaked the DUMP_NULL_AS_TILDE explanation --- components/yaml.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/yaml.rst b/components/yaml.rst index bc6a4bc3634..3ca9b68c486 100644 --- a/components/yaml.rst +++ b/components/yaml.rst @@ -375,17 +375,17 @@ objects, they are automatically transformed into YAML tags:: $dumped = Yaml::dump($data); // $dumped = '!my_tag { foo: bar }' -Dumping null -~~~~~~~~~~~~ +Dumping Null Values +~~~~~~~~~~~~~~~~~~~ -``null`` values will be represented with ``null`` by default:: +The official YAML specification uses both ``null`` and ``~`` to represent null +values. This component uses ``null`` by default when dumping null values but +you can dump them as ``~`` with the ``DUMP_NULL_AS_TILDE`` flag:: - $dumped = Yaml::dump(array('foo' => null)); + $dumped = Yaml::dump(['foo' => null]); // foo: null -You can represent them with ``~`` by using the ``DUMP_NULL_AS_TILDE`` flag:: - - $dumped = Yaml::dump(array('foo' => null), 2, 4, Yaml::DUMP_NULL_AS_TILDE); + $dumped = Yaml::dump(['foo' => null], 2, 4, Yaml::DUMP_NULL_AS_TILDE); // foo: ~ .. versionadded:: 4.4