$object->($string)
<p>I am dealing with an object of a class that I did not write and cannot change.This class has a very large number of attributes. I want to cycle trough about half of these attributes (a select group).  I put the names of the nescessary attributes into an array and would like to cycle through them.     Is this possible? What is the syntax like?</p>

<pre><code>class B{
   public $foo = 'hi';
   public $bar = 'bye';
   ...etc, etc.
}

$arr = array(1=&gt;'foo', 2=&gt;'bar', ...)
$b = new B();
foreach($arr as $val){
  echo $b-&gt;($val); //&lt;-----does not work
}
</code></pre>
