<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 23 May 2013 20:18:59 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Timothy Boronczyk's Blog: Currying in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/12851</guid>
      <link>http://www.phpdeveloper.org/news/12851</link>
      <description><![CDATA[<p>
<i>Timothy Boronczyk</i> has <a href="http://zaemis.blogspot.com/2009/06/currying-in-php.html">posted about</a> an interesting concept you could use in your applications - currying (made possible in PHP 5.3.x and above):
</p>
<blockquote>
What happens if you don't have all the arguments handy for a function, but you want to give whatever arguments you do have now and then provide the rest of them to the function later? This is called <A href="http://en.wikipedia.org/wiki/Currying">currying</a>, and is a core concept in functional programming. It's messy, but possible to curry functions in PHP now that <a href="http://zaemis.blogspot.com/2009/03/anonymous-functions-and-closures.html">closures have been added</a>.
</blockquote>
<p>
He starts with an example from OCaml/F# to illustrate the point and moves to a PHP example - changing a normal function that requires three parameters into one that makes it possible to only submit the parameters you'd want to use. He also includes a more "real life" example of how it could be used in array filtering.
</p>]]></description>
      <pubDate>Fri, 10 Jul 2009 13:33:18 -0500</pubDate>
    </item>
  </channel>
</rss>
