Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Different behaviours of YAML parsing of NULL with !php/const and !php/const: #25307

Closed
@IwfY

Description

@IwfY
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.4.0

The deprecation warning suggests when parsing a YAML file to use !php/const instead of !php/const: for PHP constants. But the former is not able to evaluate the NULL constant.
See the difference between
https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Yaml/Inline.php#L697
and
https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Yaml/Inline.php#L710

self::parseScalar('null') returns the empty string so constant('') fails.

What should be used in YAML to express PHP's NULL constant?

For XML definitions it is still possible: https://github.com/symfony/framework-bundle/blob/master/Resources/config/workflow.xml#L12

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions