User error: "1" is an invalid render array key in Drupal\Core\Render\Element::children() I want to print "your_variable" (array) in my twig template, but i have errors.

I have .theme in my theme  :

function MYTHEME_preprocess_views_view_fields(&amp;$vars) {
   $tempstore = \Drupal::service('user.private_tempstore')-&gt;get('evenementrimouski');
   $some_data = $tempstore-&gt;get('nid');
   $vars['your_variable'][] = array(3,4,5,6);
}


My "views-view-field" twig :

{% for  value in your_variable %}
    {{ value }}
{% endfor %}


The code work but i have errors :

User error: "0" is an invalid render array key in Drupal\Core\Render\Element::children() (line 97 of core/lib/Drupal/Core/Render/Element.php).

User error: "1" is an invalid render array key in Drupal\Core\Render\Element::children() (line 97 of core/lib/Drupal/Core/Render/Element.php).


Someone have idea to resolve this problem ?

I use Drupal 8
Remove the brackets after the ['your_variable'] part as your variable holds only 1 array:

function MYTHEME_preprocess_views_view_fields(&amp;$vars) {
   $tempstore = \Drupal::service('user.private_tempstore')-&gt;get('evenementrimouski');
   $some_data = $tempstore-&gt;get('nid');
   $vars['your_variable'] = [3,4,5,6];
}


Also use the short array syntax. It's part of the new coding standards: https://www.drupal.org/node/2135291