Skip to content

[Yaml] ~ is not interpreted as null when used as array key #23664

Closed
@ivoba

Description

@ivoba
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.3.5

When using ~ as array key its interpreted as string "~" since i upgraded to symfony 3.3.
Before it was interpreted as null resp. "".

As it is in Yaml spec it should be interpreted as null even as key, i suppose:
http://www.yaml.org/type/null.html

Example:

my_service:
  class: SomeClass
  arguments:
    -
     ~: 'default'
     key: 'value'

Arguments results in:

array:2 [▼
"~" => "default"
"key" => "value"
]

Expected would have been:

array:2 [▼
"" => "default"
"key" => "value"
]

Is this intended behaviour?

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