function filescan() { if ($this->is_dir()) { $files = array(); $handle = opendir($this->absfilepath); while (false !== ($file = readdir($handle))) { # Call filescan on these files too $tempfileobj = new bhfile($this->filepath . "/" . $file); $tempfileobj->filescan(); } } }