### Parse Tagged Scalars Source: https://github.com/symfony/yaml/blob/8.2/CHANGELOG.md Example of parsing a custom tag using the Yaml::PARSE_CUSTOM_TAGS flag. ```yaml Yaml::parse('!foo bar', Yaml::PARSE_CUSTOM_TAGS); // returns TaggedValue('foo', 'bar'); ``` -------------------------------- ### Parsing non-string mapping keys Source: https://github.com/symfony/yaml/blob/8.2/CHANGELOG.md Demonstrates the transition from implicit non-string keys to explicit string keys using quotes. ```php $yaml = << new A(), 'bar' => 1], 0, 0, Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE | Yaml::DUMP_OBJECT); ``` -------------------------------- ### Customizing parser behavior Source: https://github.com/symfony/yaml/blob/8.2/CHANGELOG.md Uses a bit field to configure specific parsing behaviors for objects and invalid types. ```php Yaml::parse('{ "foo": "bar", "fiz": "cat" }', Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE | Yaml::PARSE_OBJECT | Yaml::PARSE_OBJECT_FOR_MAP); ``` -------------------------------- ### Parsing PHP constants Source: https://github.com/symfony/yaml/blob/8.2/CHANGELOG.md Enables the parser to resolve PHP constants using the PARSE_CONSTANT flag. ```php Yaml::parse('!php/const:PHP_INT_MAX', Yaml::PARSE_CONSTANT); ``` -------------------------------- ### Parsing timestamps as DateTime objects Source: https://github.com/symfony/yaml/blob/8.2/CHANGELOG.md Configures the parser to return DateTime objects instead of strings for timestamp values. ```php Yaml::parse('2001-12-15 21:59:43.10 -5', Yaml::PARSE_DATETIME); ``` -------------------------------- ### Escaping backslashes in double-quoted strings Source: https://github.com/symfony/yaml/blob/8.2/CHANGELOG.md Shows the requirement to escape backslashes within double-quoted YAML strings. ```yml class: "Foo\Var" ``` ```yml class: "Foo\\Var" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.