Declaration of DrushInputAdapter::hasParameterOption($values) must be compatible with Symfony I have a Drupal 8 site set up with Acquia Dev Desktop on my localhost. I am using PHP 7.0.14; everything is working fine, and the site works perfectly.

I installed Drush 8.  When I try to run drush cr all, I get this error message.


  PHP Fatal error:  Declaration of Drush\Command\DrushInputAdapter::hasParameterOption($values) must be compatible with Symfony\Component\Console\Input\InputInterface::hasParameterOption($values, $onlyParams = false) in /Applications/DevDesktop/tools/vendor/drush/drush/lib/Drush/Command/DrushInputAdapter.php on line 27


The lines causing the error are the following ones.

class DrushInputAdapter implements InputInterface {
    protected $arguments;
    protected $options;
    protected $interactive;

    public function __construct($arguments, $options, $command = false, $interactive = true)
    {
        $this-&gt;arguments = $arguments;
        $this-&gt;options = $options;

        // If a command name is provided as a parameter, then push
        // it onto the front of the arguments list as a service
        if ($command) {
            $this-&gt;arguments = array_merge(
                [ 'command' =&gt; $command ],
                $this-&gt;arguments
            );
        }
        // Is it interactive, or is it not interactive?
        // Call drush_get_option() here if value not passed in?
        $this-&gt;interactive = $interactive;
    }


With Drupal Console, I get something similar.


  PHP Fatal error:  Declaration of Drupal\Component\DependencyInjection\Container::set($id, $service) must be compatible with Symfony\Component\DependencyInjection\ContainerInterface::set($id, $service, $scope = self::SCOPE_CONTAINER) in /Users/josue/WebDevelop/drupal-8.4.0/core/lib/Drupal/Component/DependencyInjection/Container.php on line 47
Updating to Drush 9, as suggested in the comment by user3346970, is certainly one solution to this problem. If you wish to stick with Drush 8, upgrade to version 8.1.15 or later. The problem you report above was fixed somewhere around version 8.1.12.

I'm not certain about the exact versions of Drupal Console to use with each version of Drupal, but I believe that you will probably also discover that updating to the latest version should resolve things as well. The error you are seeing indicates you are crossing Symfony version 2 (e.g. in an old version of Drush or Drupal Console) with Symfony version 3 (e.g. in Drupal 8.4.0 and later).