<?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 12:17:32 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[ThinkPHP Blog: Spooky Action at not so much Distance]]></title>
      <guid>http://www.phpdeveloper.org/news/8692</guid>
      <link>http://www.phpdeveloper.org/news/8692</link>
      <description><![CDATA[<p>
<i>Martin Brotzeller</i> came across an interesting behavior in a <a href="http://blog.thinkphp.de/archives/256-Spooky-Action-at-not-so-much-Distance.html">script he was recently</a> working on involving two classes and an error that should have been thrown.
</p>
<blockquote>
Over the weekend i encountered a twist in PHP that really left me wondering. I made a mistake and i thought i should have gotten an error, or at least a warning. I got a completely unexpected behavior instead. According to our <a href="http://schlueters.de/">PHP Oracle</a> this is just a legacy from PHP 4 though and there was much Discussion whether changing this behavior would break old apps. I think it's a possible source of hard-to-track errors though.
</blockquote>
<p>
<a href="http://blog.thinkphp.de/archives/256-Spooky-Action-at-not-so-much-Distance.html">His code</a> creates an object, a and calls the bar() method. Inside bar(), object b is created and the foo() method of b is called. The real oddity comes in when, inside the b->foo() call, $this->mprint() is called but it's the one defined in object a that executes, not in b.
</p>]]></description>
      <pubDate>Thu, 20 Sep 2007 10:27:00 -0500</pubDate>
    </item>
  </channel>
</rss>
