Using the example from wikipedia,
http://en.wikipedia.org/wiki/Yaml#Data_merge_and_references, the second
step should be populated with the first step data, then change/overwrite
the hash values.
Instead, it's creating an array value of '>>' and populating that.
<? // test_yaml.php
require_once 'spyc.php';
$yaml_data = <<< HERE_DOC
# sequencer protocols for Laser eye surgery
---
- step: &id001 # defines anchor label &id001
instrument: Lasik 2000
pulseEnergy: 5.4
pulseDuration: 12
repetition: 1000
spotSize: 1mm
- step:
<<: *id001 # merges key:value pairs defined in step1
anchor
spotSize: 2mm # overrides "spotSize" key's value
- step:
<<: *id001 # merges key:value pairs defined in step1
anchor
pulseEnergy: 500.0 # overrides key
alert: > # adds additional key
warn patient of
audible pop
HERE_DOC;
print "<pre>";
var_dump(Spyc::YAMLLoad($yaml_data));
Original issue reported on code.google.com by tac...@gmail.com on 20 Jul 2009 at 11:33
Original issue reported on code.google.com by
tac...@gmail.com
on 20 Jul 2009 at 11:33Attachments: