<?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>Sun, 19 May 2013 19:04:32 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Till Klampaeckel's Blog: Monkey patching in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/14690</guid>
      <link>http://www.phpdeveloper.org/news/14690</link>
      <description><![CDATA[<p>
In a new post to his blog today <i>Till Klampaeckel</i> takes <a href="http://till.klampaeckel.de/blog/archives/105-Monkey-patching-in-PHP.html">a look at monkey patching</a> in PHP - a way to replace functions at runtime.
</p>
<blockquote>
I haven't really had the chance or time to play with PHP 5.3  until recently when Ubuntu 10.04 upgraded my local installations and kind of forced me to dive into it a little. And I'm also probably the last person on the planet to notice, but namespaces in PHP 5.3 allow you to monkey-patch core PHP code. [...] One of the more common applications is stubbing (or mocking) code in unit tests.
</blockquote>
<p>
He includes a code sample showing how you can use a simple namespace hack to call a function from another namespace named the same as an internal one - in this case <a href="http://php.net/strlen">strlen</a>.
</p>]]></description>
      <pubDate>Wed, 23 Jun 2010 10:31:09 -0500</pubDate>
    </item>
  </channel>
</rss>
