File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -375,17 +375,17 @@ objects, they are automatically transformed into YAML tags::
375375 $dumped = Yaml::dump($data);
376376 // $dumped = '!my_tag { foo: bar }'
377377
378- Dumping null
379- ~~~~~~~~~~~~
378+ Dumping Null Values
379+ ~~~~~~~~~~~~~~~~~~~
380380
381- ``null `` values will be represented with ``null `` by default::
381+ The official YAML specification uses both ``null `` and ``~ `` to represent null
382+ values. This component uses ``null `` by default when dumping null values but
383+ you can dump them as ``~ `` with the ``DUMP_NULL_AS_TILDE `` flag::
382384
383- $dumped = Yaml::dump(array( 'foo' => null) );
385+ $dumped = Yaml::dump([ 'foo' => null] );
384386 // foo: null
385387
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);
388+ $dumped = Yaml::dump(['foo' => null], 2, 4, Yaml::DUMP_NULL_AS_TILDE);
389389 // foo: ~
390390
391391.. versionadded :: 4.4
You can’t perform that action at this time.
0 commit comments