Mappings with a colon (:
) that is not followed by a whitespace are deprecated
and will lead to a ParseException
in Symfony 4.0 (e.g. foo:bar
must be
foo: bar
).
Added support for parsing PHP constants:
Yaml::parse('!php/const:PHP_INT_MAX', Yaml::PARSE_CONSTANT);
ParseException
in Symfony 4.0.Strings that are not UTF-8 encoded will be dumped as base64 encoded binary data.
Added support for dumping multi line strings as literal blocks.
Added support for parsing base64 encoded binary data when they are tagged
with the !!binary
tag.
Added support for parsing timestamps as \DateTime
objects:
Yaml::parse('2001-12-15 21:59:43.10 -5', Yaml::PARSE_DATETIME);
\DateTime
and \DateTimeImmutable
objects are dumped as YAML timestamps.
Deprecated usage of %
at the beginning of an unquoted string.
Added support for customizing the YAML parser behavior through an optional bit field:
Yaml::parse('{ "foo": "bar", "fiz": "cat" }', Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE | Yaml::PARSE_OBJECT | Yaml::PARSE_OBJECT_FOR_MAP);
Yaml::dump(array('foo' => new A(), 'bar' => 1), 0, 0, Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE | Yaml::DUMP_OBJECT);
\
characters. Not
escaping those characters (when surrounded by double-quotes) is deprecated.Before:
class: "Foo\Var"
After:
class: "Foo\\Var"