# $this for a function which is not a method of any class. #Remove $this # Instead of: $test = $this->compareFiles($file1,$file2,true); # Use: $test = compareFiles($file1,$file2,true);