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::
341341Parsing and Dumping of Binary Data
342342~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
343343
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 ::
345345
346346 $imageContents = file_get_contents(__DIR__.'/images/logo.png');
347347
348- $dumped = Yaml::dump(['logo' => $imageContents], 2, 4, Yaml::DUMP_BASE64_BINARY_DATA );
348+ $dumped = Yaml::dump(['logo' => $imageContents]);
349349 // logo: !!binary iVBORw0KGgoAAAANSUhEUgAAA6oAAADqCAY...
350350
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::
353352
354353 $dumped = 'logo: !!binary iVBORw0KGgoAAAANSUhEUgAAA6oAAADqCAY...';
355354 $parsed = Yaml::parse($dumped);
You can’t perform that action at this time.
0 commit comments