yaml
yaml copied to clipboard
Anchors with dash is not working
Hi!
Unfortunately valid YAML is not parsed as expected. Look at example below:
$yamlContent = <<<EOF
anchor_definition: &anchor-name OK
anchor_call: *anchor-name
EOF;
$obj = Yaml::parse($yamlContent);
print_r($obj->anchor_definition); //&anchor-name OK
print_r($obj->anchor_call); //*anchor-name
print_r($obj->getAllReferences()); //Array ( )
print_r($obj->getReference('anchor-name')); //UnexpectedValueException: no reference named: 'anchor-name', known are : () (0)