title: Call methods of objects in array using array_map?
body: <p>Suppose I have simple class like:</p>
  
  <pre><code>class MyClass {
    private $_prop;
    public function getProp() {return $this-&gt;_prop;}
    [....]
  }
  </code></pre>
  
  <p>Now what I want to do somwhere not in scope of <code>MyClass</code> is to get array of $_prop from array of objects of <code>MyClass</code>(<code>$objs</code>). This of course can be done with code like this:</p>
  
  <pre><code>$props = array();
  foreach ($objs as $obj) {
      $props[] = $obj-&gt;getProp();
  }
  </code></pre>
  
  <p>However this takes quote some lines, esp when formated in this way (and I have to use such formatting). So question is: if it is possible to do this using array_map? One way would be to use create function, but I don't really like that in php(lambdas in php are at least awkward and if i understand correctly its performance is like that of evaled code, but performance is beside the point here). I have tired searching quite a bit and failed to find any definetive answer. But I kinda have a feeling that it's not possible. I tried things like <code>array_map(array('MyClass', 'getProp'), $objs)</code>, but that does not work since method is not static.</p>
  
  <p>Edit: I'm using php 5.3.</p>