Your question got me thinking - but I only edited paypal.php and I made a backup before hand which I restored and this did not fix the problem.
So I trawled through the code in modules.php that was not loading and found that it counted the number of php files in the modules/payment directory.
Yahoo this is the cause of the error. I had backed up the paypal.php file to paypal2.php into the directory and now it located a file that had no data base entries.
So I shifted paypal2.php to local drive and now everything works again.
This is definitely a trap for cautious young players.
// Modules.php
$file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
$directory_array = array();
if ($dir = @dir($module_directory)) {
while ($file = $dir->read()) {
if (!is_dir($module_directory . $file)) {
if (substr($file, strrpos($file, '.')) == $file_extension) {
$directory_array[] = $file;
}
}
}
sort($directory_array);
$dir->close();
}