<p dir="auto">Hi,</p>
<p dir="auto">we updated from Symfony <code class="notranslate">2.6</code> to <code class="notranslate">2.8</code> with the choice options you can find below.<br>
We expected the label of our choice type should be hidden and just the value and the input element exists. In 2.6 this worked for us.</p>
<p dir="auto">When we upgraded to 2.8 (with the same options) the labels are shown again. The Problem is caused by an empty string in the view, not as expected <code class="notranslate">false</code>.</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$resolver-&gt;setDefaults([
    'choices' =&gt; [1 =&gt; false, 2 =&gt; false, 3 =&gt; false, 4 =&gt; false, 5 =&gt; false],
    'expanded' =&gt; true,
    'placeholder' =&gt; false,
    'required' =&gt; false,
]);"><pre class="notranslate"><span class="pl-s1"><span class="pl-c1">$</span>resolver</span>-&gt;<span class="pl-en">setDefaults</span>([
    <span class="pl-s">'choices'</span> =&gt; [<span class="pl-c1">1</span> =&gt; <span class="pl-c1">false</span>, <span class="pl-c1">2</span> =&gt; <span class="pl-c1">false</span>, <span class="pl-c1">3</span> =&gt; <span class="pl-c1">false</span>, <span class="pl-c1">4</span> =&gt; <span class="pl-c1">false</span>, <span class="pl-c1">5</span> =&gt; <span class="pl-c1">false</span>],
    <span class="pl-s">'expanded'</span> =&gt; <span class="pl-c1">true</span>,
    <span class="pl-s">'placeholder'</span> =&gt; <span class="pl-c1">false</span>,
    <span class="pl-s">'required'</span> =&gt; <span class="pl-c1">false</span>,
]);</pre></div>
<p dir="auto">So we added a workaround in our <code class="notranslate">bootstrap_3_layout.html.twig</code> to resolve this.</p>
<div class="highlight highlight-text-html-twig notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{%- block radio_label -%}
    {% if label == '' or label is null %}
        {% set label = false %}
    {% endif %}

    {{ parent() }}
{%- endblock radio_label -%}"><pre class="notranslate">{%- <span class="pl-k">block</span> <span class="pl-smi">radio_label</span> -%}
    {% <span class="pl-k">if</span> <span class="pl-smi">label</span> <span class="pl-k">==</span> <span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span> <span class="pl-k">or</span> <span class="pl-smi">label</span> <span class="pl-k">is</span> <span class="pl-c1">null</span> %}
        {% <span class="pl-k">set</span> <span class="pl-smi">label</span> <span class="pl-k">=</span> <span class="pl-c1">false</span> %}
    {% <span class="pl-k">endif</span> %}

    {{ <span class="pl-c1">parent</span>() }}
{%- <span class="pl-k">endblock</span> <span class="pl-smi">radio_label</span> -%}</pre></div>
<p dir="auto">Is there a cleaner way to hide the label or is this a bug/bc break?</p>
<p dir="auto">Thanks</p>
<p dir="auto">After upgrading from 2.7.7 to 2.7.8 I noticed that some choice fields didn't display the empty value.</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="-&gt;add('buyback', 'choice', [
    'choices' =&gt; [
        'Yes'  =&gt; true,
        'No'   =&gt; false,
    ],
    'choices_as_values' =&gt; true,
    'required'          =&gt; false,
]);"><pre class="notranslate">-&gt;add(<span class="pl-s">'buyback'</span>, <span class="pl-s">'choice'</span>, [
    <span class="pl-s">'choices'</span> =&gt; [
        <span class="pl-s">'Yes'</span>  =&gt; <span class="pl-c1">true</span>,
        <span class="pl-s">'No'</span>   =&gt; <span class="pl-c1">false</span>,
    ],
    <span class="pl-s">'choices_as_values'</span> =&gt; <span class="pl-c1">true</span>,
    <span class="pl-s">'required'</span>          =&gt; <span class="pl-c1">false</span>,
]);</pre></div>
<p dir="auto">Before:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/407855/12170811/144496ea-b54d-11e5-9a28-a44c9f48ddd5.png"><img src="https://cloud.githubusercontent.com/assets/407855/12170811/144496ea-b54d-11e5-9a28-a44c9f48ddd5.png" alt="image" style="max-width: 100%;"></a><br>
After:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/407855/12170840/3e399e5a-b54d-11e5-9032-4e0d49fe2a37.png"><img src="https://cloud.githubusercontent.com/assets/407855/12170840/3e399e5a-b54d-11e5-9032-4e0d49fe2a37.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">So far I've found out that the <code class="notranslate">false</code> value is converted to empty string in this line <a class="commit-link" href="https://github.com/symfony/symfony/compare/v2.7.7...v2.7.8#diff-780e59a429c485d2d3b8a37fdf62ac59R79"><tt>v2.7.7...v2.7.8</tt>#diff-780e59a429c485d2d3b8a37fdf62ac59R79</a>.</p>
<p dir="auto">I think that the <code class="notranslate">false</code> value is displayed instead of empty value because of that.</p>
<p dir="auto">This bug was introduced in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="119163490" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/16705" data-hovercard-type="pull_request" data-hovercard-url="/symfony/symfony/pull/16705/hovercard" href="https://github.com/symfony/symfony/pull/16705">#16705</a>.</p>