Setting numerical key values in a hash
The answer is to prepend a letter to the numerical key…
{% for entry in entries %}
    {% set eId   = &quot;e#{entry.id}&quot; %} {# interpolation* #}
    {% set value = entry.intro %}

    {% set myHash = myHash|merge({
        (eId) : { intro : value }
    }) %}
{% endfor %}

Now the hash stores the custom key as a string…
array(10) {
  [&quot;e1234&quot;]=&gt;
  array(1) {
    [&quot;intro&quot;]=&gt;
    string(13) &quot;My intro text&quot;
…


…which you can clean up as needed…
{% for key, properties in hash %}
    {% set key = key|replace('e', '') %}
    …
{% endfor %}

…or factor into lookups…
{% set testId    = 'e1234' %}
{% set testIntro = myHash[testId].intro %}
{# `testIntro`  == 'My intro text' #}

Apparently, it's a PHP thing.
*Interpolation is often preferable to concatenation &lt;-- see item #4.