I just transferred a Drupal 7 installation to Debian 9 and when I try to connect to the site I get the error
PHP Fatal error: Cannot use "self" when no class scope is active in vars.module on line 39.
There is a Drupal issue on it Upgrade to PHP7: Cannot use "self" when no class scope is active [#2668622] , but it doesn't seem to be fully resolved and I am not sure which PHP7 version it works on.
The version of PHP currently on Debian 9 is PHP Version 7.0.27-0+deb9u1
The point is I am running the latest version (Drupal 7.59) on Ubuntu 16.04 whose PHP version is PHP Version 7.0.30-0ubuntu0.16.04.1 and it runs without that error.
Are there versions of PHP 7 running on Debian 9 which work with latest unpatched Drupal 7.59, perhaps later ones like PHP 7.1 or PHP 7.2?
Maybe the bug only manifests in early versions of PHP 7.
UPDATE: It turns out that
vars.module is from the contrib module Variable API and not part of core, and was only enabled to support the Textile module. Disabling it solved the problem.