File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -341,15 +341,14 @@ syntax to parse them as proper PHP constants::
341
341
Parsing and Dumping of Binary Data
342
342
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
343
343
344
- You can dump binary data by using the `` DUMP_BASE64_BINARY_DATA `` flag ::
344
+ Non UTF-8 encoded strings are dumped as base64 encoded data ::
345
345
346
346
$imageContents = file_get_contents(__DIR__.'/images/logo.png');
347
347
348
- $dumped = Yaml::dump(['logo' => $imageContents], 2, 4, Yaml::DUMP_BASE64_BINARY_DATA );
348
+ $dumped = Yaml::dump(['logo' => $imageContents]);
349
349
// logo: !!binary iVBORw0KGgoAAAANSUhEUgAAA6oAAADqCAY...
350
350
351
- Binary data is automatically parsed if they include the ``!!binary `` YAML tag
352
- (there's no need to pass any flag to the Yaml parser)::
351
+ Binary data is automatically parsed if they include the ``!!binary `` YAML tag::
353
352
354
353
$dumped = 'logo: !!binary iVBORw0KGgoAAAANSUhEUgAAA6oAAADqCAY...';
355
354
$parsed = Yaml::parse($dumped);
You can’t perform that action at this time.
0 commit comments