0

I am trying to run a slim project, and its throwing an error from the Dispatcher file. the error is on this function: public function getListeners($eventName) { $listeners = $this->listeners[$eventName] ?? [];

    $listeners = array_merge(
        $listeners,
        $this->wildcardsCache[$eventName] ?? $this->getWildcardListeners($eventName)
    );

    return class_exists($eventName, false)
                ? $this->addInterfaceListeners($eventName, $listeners)
                : $listeners;
}

any suggestion on how to correct this error?

1 Answers1

0

Probably your PHP version in VS code is set wrongly. E.g. PHP5.6 when the actual code runs on a higher version.

The null coalescing operator was added in PHP 7.

thephper
  • 2,342
  • 22
  • 21