title: Calling Class property using variables in Zend
body: <p>I am creating partials where an items property names are passed from an array to access the values of those properties but I receive an error saying <code>Undefined property of Namespace\Entity::$variable</code> when defining <code>$property-&gt;{$variable}</code>.  How would I go about getting this to work? </p>
  
  <p>Here is an example of the code: </p>
  
  <pre><code>foreach ($items as $item) {
      $thumb_sizes = [];
      foreach ($image_sizes as $thumb_size) {
          if(!empty($item-&gt;thumb{$thumb_size})) {
              array_push($thumb_sizes, preg_replace('/^http:/i','https:',$item-&gt;thumb{$thumb_size}));
          }
      }
  }
  </code></pre>