--TEST-- yaml_parse - callbacks --SKIPIF-- --FILE-- $v) { $new_value .= "'{$k}' => '{$v}', "; } $value = trim($new_value, ', '); } return ""; } // yaml with some custom tags $yaml_str = << "value_c" key_d : !tag_d | some text key_e : !tag_e > some text key_f : !tag_f [ one, two ] key_g : !tag_g { sky: blue, sea: green } key_h : !tag_h - one - two key_i : !tag_i sky: blue sea: green ... YAML; $yaml = yaml_parse($yaml_str, 0, $ndocs, array( "test-tag_a" => "tag_callback", "test2-tag_b" => "tag_callback", "tag:example.com,2011:test/tag_c" => "tag_callback", "test-tag_d" => "tag_callback", "test-tag_e" => "tag_callback", "test-tag_f" => "tag_callback", "test-tag_g" => "tag_callback", "test-tag_h" => "tag_callback", "test-tag_i" => "tag_callback", )); var_dump($yaml); var_dump($ndocs); ?> --EXPECT-- array(9) { ["key_a"]=> string(46) "" ["key_b"]=> string(47) "" ["key_c"]=> string(67) "" ["key_d"]=> string(49) "" ["key_e"]=> string(49) "" ["key_f"]=> string(65) " 'one', '1' => 'two'], tag=[test-tag_f], flags=[0]>" ["key_g"]=> string(72) " 'blue', 'sea' => 'green'], tag=[test-tag_g], flags=[0]>" ["key_h"]=> string(65) " 'one', '1' => 'two'], tag=[test-tag_h], flags=[0]>" ["key_i"]=> string(72) " 'blue', 'sea' => 'green'], tag=[test-tag_i], flags=[0]>" } int(1)