title: Twig Type Reflection in Symfony 2
body: <p>I'm working in a generic <em>index.html.twig</em> template, for testing purposes. So, I want to check the objects properties arriving to the view. I'm testing a lister for any entity in my database. </p>
  
  <p>I'll loop an object's keys obtained. But the function: <strong>keys</strong>, from Twig official book, only works with with arrays or collections. 
  Exists any solution to this? </p>
  
  <p>Here goes the code:</p>
  
  <pre><code>{% if model and model.data %}
   {% set firstKeys= model.data|first %}     
      {% for key, item in firstKeys %}
          {{ attribute(item, key) }}&lt;br&gt;   
      {% endfor %}
      &lt;p&gt;
           ...
      &lt;/p&gt;
  
  {% endif %} 
  </code></pre>