Skip to content

Yaml parser incorrectly parses some yaml block sequences #40438

Closed
@andris-sevcenko

Description

@andris-sevcenko

Symfony version(s) affected: 5.x-dev

Description
Symfony Yaml parser incorrectly parses some block sequences.
In particular, if using this test data, the output produced is

[
  "- s1_i1 - s1_i2",
  "s2"
]

which is not the expected output as per the test.

How to reproduce

<?php
require_once '../vendor/autoload.php';

$yaml = <<<Y
- - s1_i1
  - s1_i2
- s2
Y;


echo(json_encode(\Symfony\Component\Yaml\Yaml::parse($yaml)));

Additional context
Related issues:

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