title: How can I use PHP 5.3 Closures like We use Blocks in Ruby
body: <p>How can I use PHP 5.3 Closures like We use Blocks in Ruby.
  I never used 'for' Loop in Ruby due to using Blocks with 'each' 'find_all' 'inject' Methods.</p>
  
  <p>How can I use PHP 5.3 Closures like Ruby Blocks and say bye-bye to 'for' Loops :)</p>
  
  <p>Like Between { and } is a Closure(or Block or Anonymous Function)</p>
  
  <pre><code>fruit = %w[apple banana orange]
  fruit.each { |f| print "#{f}, " }
  </code></pre>
  
  <p>I do it in PHP this way,</p>
  
  <pre><code>$fruit = array('apple', 'banana', 'orange');
  foreach ($fruit as $f) 
  {
   print "$f, "; 
  }
  </code></pre>
  
  <p>Is there a way to do this the Ruby way using PHP Closures as PHP 5.3 supports it.</p>