title: PHP instantiating child class
body: <p>I'm trying to become an object-oriented coder here, so I'm giving myself some simple tasks.<br>
  I built a class that displays all the images in a given directory.  That worked fine, so I separated that class into two classes, one to read the filenames in the directory and pass them into an array, and one to parse that array and display the pictures.  The method in the child class is exactly the same as it was when it was in the parent class (except of course substituting parent:: for this->).</p>
  
  <p>Now it seems when I instantiate the child class and call its method, nothing happens at all. </p>
  
  <p><strong>Classes:</strong></p>
  
  <pre><code>class Picfind
  {
     public function findPics($dir){
         $files = array();
         $i=0;
         $handle = opendir($dir);
         while (false !== ($file = readdir($handle))){
             $extension = strtolower(substr(strrchr($file, '.'), 1));
             if($extension == 'jpg' || $extension == 'gif' || $extension == 'png'){
                  // now use $file as you like
                  $i++;
                  $files['file' . $i] = $file;
             }
         }
         return $files;
      }
  }
  
  class DisplayPics extends Picfind
  {
  
      function diplayPics($dir) 
      {
          echo 'displayPics method called';
  
          foreach(parent::findPics($dir) as $key =&gt; $val) {
              echo '&lt;img src="' . $dir . $val . '" img&gt;&lt;br/&gt;';
          }
      }
  }
  </code></pre>
  
  <p><strong>Instantiation:</strong></p>
  
  <pre><code>include("class.picFind.php");
  $Myclass = new DisplayPics();
  $Myclass-&gt;displayPics('./images/');
  </code></pre>