<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>yes</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.3.6</td>
</tr>
</tbody>
</table>
<p dir="auto">symfony/web-profiler-bundle 3.3.6<br>
symfony/security 3.3.6<br>
Silex 2</p>
<p dir="auto">the web profiler crash with</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" (1/1) Twig_Error_Syntax
Unknown argument &quot;max_depth&quot; for function &quot;profiler_dump(value)&quot;."><pre class="notranslate"><code class="notranslate"> (1/1) Twig_Error_Syntax
Unknown argument "max_depth" for function "profiler_dump(value)".
</code></pre></div>
<p dir="auto">seams <code class="notranslate">symfony/web-profiler-bundle/Twig/WebProfilerExtension.php</code> has a deprecated (?) function.</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// line 31
    public function getFunctions()
    {
        return array(
            new \Twig_SimpleFunction('profiler_dump', array($this, 'dumpValue')),
        );
    }

    public function dumpValue($value) // &lt;-- just adding a parameter $maxDepth here fix the crash (but does nothing of course)
    {
        if (null === $this-&gt;valueExporter) {
            $this-&gt;valueExporter = new ValueExporter();
        }

        return $this-&gt;valueExporter-&gt;exportValue($value);
    }"><pre class="notranslate"><span class="pl-c">// line 31</span>
    <span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">getFunctions</span>()
    {
        <span class="pl-k">return</span> <span class="pl-en">array</span>(
            <span class="pl-k">new</span> \<span class="pl-v">Twig_SimpleFunction</span>(<span class="pl-s">'profiler_dump'</span>, <span class="pl-en">array</span>(<span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>, <span class="pl-s">'dumpValue'</span>)),
        );
    }

    <span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">dumpValue</span>(<span class="pl-s1"><span class="pl-c1">$</span>value</span>) <span class="pl-c">// &lt;-- just adding a parameter $maxDepth here fix the crash (but does nothing of course)</span>
    {
        <span class="pl-k">if</span> (<span class="pl-c1">null</span> === <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-c1">valueExporter</span>) {
            <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-c1">valueExporter</span> = <span class="pl-k">new</span> <span class="pl-v">ValueExporter</span>();
        }

        <span class="pl-k">return</span> <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-c1">valueExporter</span>-&gt;<span class="pl-en">exportValue</span>(<span class="pl-s1"><span class="pl-c1">$</span>value</span>);
    }</pre></div>
<p dir="auto">I'm duplicating this issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="249897796" data-permission-text="Title is private" data-url="https://github.com/silexphp/Silex-WebProfiler/issues/124" data-hovercard-type="issue" data-hovercard-url="/silexphp/Silex-WebProfiler/issues/124/hovercard" href="https://github.com/silexphp/Silex-WebProfiler/issues/124">silexphp/Silex-WebProfiler#124</a></p>
<p dir="auto">The form component DateType does not follow the documented behavior and naive selection process breaks any attempt to utilize the DateType element pattern field.</p>
<p dir="auto">According to the <a href="http://symfony.com/doc/2.0/reference/forms/types/date.html#pattern" rel="nofollow">official documentation</a> the DateType will first check for the <code class="notranslate">pattern</code> configuration. If none is set, it will attempt to convert the <code class="notranslate">format</code> option. Finally if neither are set it will use a default pattern.</p>
<p dir="auto">If you notice the <a href="https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Extension/Core/Type/DateType.php#L147">relevant code (DateType.php line 147)</a> you will see the pattern selection completely ignores the <code class="notranslate">pattern</code> option (instead pulls in the <code class="notranslate">format</code>), the regex on line 156 in using the 3 matching groups accidentally requires that 3 fields be present (even though those 3 fields could be the same portion, e.g. 3 year dropdowns).</p>
<p dir="auto">Essentially as of right  now the behavior is: <code class="notranslate">pattern</code> is ignored, and <code class="notranslate">format</code> requires at least 3 elements. I will work on a patch for now to conform to documented behavior.</p>