title: "Overloading" a private method in PHP
body: <p>I know I cannot overload methods in PHP. And, as far as I know, <code>private</code> methods in a class are invisible to classes that extend the base class. So why this does not work?</p>
  
  <pre><code>class Base {
    private function foo($arg) {
       print "Base $arg";
    }
  }
  
  class Child extends Base {
    public function foo() {
       print "Child";
    }
  }
  
  $c = new Child;
  print $c-&gt;foo();
  </code></pre>
  
  <p>The error:</p>
  
  <p><code>PHP Strict Standards:  Declaration of Child::foo() should be compatible with Base::foo($arg) in /var/www/boludo.php on line 17</code></p>
  
  <p>I assumed that <code>foo($arg)</code> method is invisible in <code>Child</code> class because is <code>private</code>. So, I'm not overloading <code>foo</code>, I'm just creating a method called <code>foo</code>.</p>