8000 Bug in simple YAML references · Issue #10888 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Bug in simple YAML references #10888
Closed
Closed
@tylercollier

Description

@tylercollier

I think I've found a bug with YAML reference parsing. Referencing multiple times results in grabbing data below the referenced section. I'm using the Symfony YAML component from version 2.4.4 with PHP 5.4.23 on Ubuntu 12.04.

Given myfile.yaml:

section: &section1
    x: y
different:
    a: b
section: &section2
    << : *section1
section:
    << : *section2

Code:

print_r(Yaml::parse('myfile.yaml'));

Expected output:

[section] => Array
    (
        [x] => y
    )

[different] => Array
    (
        [a] => b
    )

Actual output:

[section] => Array
    (
        [a] => b
    )

[different] => Array
    (
        [a] => b
    )

Note how [x] => y has been replaced with [a] => b.

Note that you get the same actual output even if you remove the line x: y.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0