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::
375
375
$dumped = Yaml::dump($data);
376
376
// $dumped = '!my_tag { foo: bar }'
377
377
378
- Dumping null
379
- ~~~~~~~~~~~~
378
+ Dumping Null Values
379
+ ~~~~~~~~~~~~~~~~~~~
380
380
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::
382
384
383
- $dumped = Yaml::dump(array( 'foo' => null) );
385
+ $dumped = Yaml::dump([ 'foo' => null] );
384
386
// foo: null
385
387
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);
389
389
// foo: ~
390
390
391
391
.. versionadded :: 4.4
You can’t perform that action at this time.
0 commit comments