<p dir="auto">Symfony's YAML parser/dumper behaves differently than the PHP PECL yaml parser/dumper.</p>
<p dir="auto">Example code:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;?php

require_once(&quot;Symfony/Component/Yaml/Parser.php&quot;);
require_once(&quot;Symfony/Component/Yaml/Yaml.php&quot;);
require_once(&quot;Symfony/Component/Yaml/Inline.php&quot;);
require_once(&quot;Symfony/Component/Yaml/Dumper.php&quot;);
require_once(&quot;Symfony/Component/Yaml/Unescaper.php&quot;);
require_once(&quot;Symfony/Component/Yaml/Escaper.php&quot;);
require_once(&quot;Symfony/Component/Yaml/Exception/ExceptionInterface.php&quot;);
require_once(&quot;Symfony/Component/Yaml/Exception/DumpException.php&quot;);
require_once(&quot;Symfony/Component/Yaml/Exception/ParseException.php&quot;);


$data = array('data' =&gt; array('date' =&gt; array('cr=bla'), 'username' =&gt; 'foo'));

$yaml = (yaml_emit($data));

$parser = new Symfony\Component\Yaml\Parser();

$data2 = $parser-&gt;parse($yaml);

echo &quot;ORIG\n&quot;;
var_dump($data);
echo &quot;NEW:\n&quot;;
var_dump($data2);



?&gt;"><pre class="notranslate"><span class="pl-ent">&lt;?php</span>

<span class="pl-k">require_once</span>("<span class="pl-s">Symfony/Component/Yaml/Parser.php</span>");
<span class="pl-k">require_once</span>("<span class="pl-s">Symfony/Component/Yaml/Yaml.php</span>");
<span class="pl-k">require_once</span>("<span class="pl-s">Symfony/Component/Yaml/Inline.php</span>");
<span class="pl-k">require_once</span>("<span class="pl-s">Symfony/Component/Yaml/Dumper.php</span>");
<span class="pl-k">require_once</span>("<span class="pl-s">Symfony/Component/Yaml/Unescaper.php</span>");
<span class="pl-k">require_once</span>("<span class="pl-s">Symfony/Component/Yaml/Escaper.php</span>");
<span class="pl-k">require_once</span>("<span class="pl-s">Symfony/Component/Yaml/Exception/ExceptionInterface.php</span>");
<span class="pl-k">require_once</span>("<span class="pl-s">Symfony/Component/Yaml/Exception/DumpException.php</span>");
<span class="pl-k">require_once</span>("<span class="pl-s">Symfony/Component/Yaml/Exception/ParseException.php</span>");


<span class="pl-s1"><span class="pl-c1">$</span>data</span> = <span class="pl-en">array</span>(<span class="pl-s">'data'</span> =&gt; <span class="pl-en">array</span>(<span class="pl-s">'date'</span> =&gt; <span class="pl-en">array</span>(<span class="pl-s">'cr=bla'</span>), <span class="pl-s">'username'</span> =&gt; <span class="pl-s">'foo'</span>));

<span class="pl-s1"><span class="pl-c1">$</span>yaml</span> = (yaml_emit(<span class="pl-s1"><span class="pl-c1">$</span>data</span>));

<span class="pl-s1"><span class="pl-c1">$</span>parser</span> = <span class="pl-k">new</span> <span class="pl-v">Symfony</span>\<span class="pl-v">Component</span>\<span class="pl-v">Yaml</span>\<span class="pl-v">Parser</span>();

<span class="pl-s1"><span class="pl-c1">$</span>data2</span> = <span class="pl-s1"><span class="pl-c1">$</span>parser</span>-&gt;<span class="pl-en">parse</span>(<span class="pl-s1"><span class="pl-c1">$</span>yaml</span>);

<span class="pl-k">echo</span> "<span class="pl-s">ORIG</span>\n";
var_dump(<span class="pl-s1"><span class="pl-c1">$</span>data</span>);
<span class="pl-k">echo</span> "<span class="pl-s">NEW:</span>\n";
var_dump(<span class="pl-s1"><span class="pl-c1">$</span>data2</span>);



<span class="pl-ent">?&gt;</span></pre></div>
<p dir="auto">returns the following results:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ORIG
array(1) {
  [&quot;data&quot;]=&gt;
  array(2) {
    [&quot;date&quot;]=&gt;
    array(1) {
      [0]=&gt;
      string(6) &quot;cr=bla&quot;
    }
    [&quot;username&quot;]=&gt;
    string(3) &quot;foo&quot;
  }
}
NEW:
array(1) {
  [&quot;data&quot;]=&gt;
  array(3) {
    [&quot;date&quot;]=&gt;
    NULL
    [0]=&gt;
    string(6) &quot;cr=bla&quot;
    [&quot;username&quot;]=&gt;
    string(3) &quot;foo&quot;
  }
}"><pre class="notranslate"><code class="notranslate">ORIG
array(1) {
  ["data"]=&gt;
  array(2) {
    ["date"]=&gt;
    array(1) {
      [0]=&gt;
      string(6) "cr=bla"
    }
    ["username"]=&gt;
    string(3) "foo"
  }
}
NEW:
array(1) {
  ["data"]=&gt;
  array(3) {
    ["date"]=&gt;
    NULL
    [0]=&gt;
    string(6) "cr=bla"
    ["username"]=&gt;
    string(3) "foo"
  }
}
</code></pre></div>
<p dir="auto">This is</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="alex@debvirt:~/work/EPPTest$ php -v
PHP 5.3.3-7+squeeze3 with Suhosin-Patch (cli) (built: Jun 28 2011 13:13:26)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

alex@debvirt:~/work/EPPTest$ pecl list | fgrep yaml
yaml          1.0.1   stable

Installed packages, channel pear.symfony.com:
=============================================
Package Version State
Yaml    2.0.12  stable"><pre class="notranslate"><code class="notranslate">alex@debvirt:~/work/EPPTest$ php -v
PHP 5.3.3-7+squeeze3 with Suhosin-Patch (cli) (built: Jun 28 2011 13:13:26)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

alex@debvirt:~/work/EPPTest$ pecl list | fgrep yaml
yaml          1.0.1   stable

Installed packages, channel pear.symfony.com:
=============================================
Package Version State
Yaml    2.0.12  stable
</code></pre></div>
<p dir="auto">Hey guys!</p>
<p dir="auto">See the old discussion here: <a href="http://groups.google.com/group/symfony-devs/browse_thread/thread/d7da04699033ec07" rel="nofollow">http://groups.google.com/group/symfony-devs/browse_thread/thread/d7da04699033ec07</a></p>
<p dir="auto">Currently, there's no standard way of (when you're not using a CDN) retrieving the absolute URL to an asset. This would be useful, for example, when generating asset paths in a template for an email. I believe the best <em>current</em> solution would be something like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{{ app.request.httpHost ~ asset('images/foo.jpg') }}"><pre class="notranslate"><code class="notranslate">{{ app.request.httpHost ~ asset('images/foo.jpg') }}
</code></pre></div>
<p dir="auto">Of course, that'll break if/when I start using a CDN :).</p>
<p dir="auto">Question: is this something we should add?</p>