title: Does PHP have an equivalent to Python's list comprehension syntax?
body: <p>Python has syntactically sweet list comprehensions:</p>
  
  <pre><code>S = [x**2 for x in range(10)]
  print S;
  [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
  </code></pre>
  
  <p>In PHP I would need to do some looping:</p>
  
  <pre><code>$output = array();
  $Nums = range(0,9);
  
  foreach ($Nums as $num) 
  {
      $out[] = $num*=$num;
  }
  print_r($out);
  </code></pre>
  
  <p>to get:</p>
  
  <p>Array
  (
      [0] => 0
      [1] => 1
      [2] => 4
      [3] => 9
      [4] => 16
      [5] => 25
      [6] => 36
      [7] => 49
      [8] => 64
      [9] => 81
  )</p>
  
  <p>Is there anyway to get a similar list comprehension syntax in PHP? Is there anyway to do it with any of the new features in PHP 5.3?</p>
  
  <p>Thanks!</p>