ここで明らかな何かが欠けているように感じます。次のようなクラスがあります。
<?php
class files
{
public function getDirectoryList($directory)
{
    // create an array to hold directory list
    $results = array();
    // create a handler for the directory
    $handler = opendir($directory);
    // open directory and walk through the filenames
    while($file = readdir($handler)) 
    {
        // if the file isn't this directory or the parent, add it to the results.
        if($file != "." && $file != "..")
        {
            $results[] = $file;
        }
    }
    // tidy up: close the handler
    closedir($handler);
    //done
    return $results;
}
}
?>
これで、クラスが別のファイルに含まれるようになり、次のことを行っています。
$fileListing = new files();
$fileListing->getDirectoryList('education');
結果が返ってきません。関数をクラスから取り出してこのファイルに入れると、次のようにして結果を取得できます。
$fileListing = getDirectoryList('education');