• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question lexical error on routes.php

LesyReeds

New Pleskian
I am a beginner in this, please bear with me. I want to run a driving school system on local host xampp, but i am getting this error when i am trying to load the page:

Fatal error: Cannot use lexical variable $router as a parameter name in C:\xampp\htdocs\driving\src\routes.php on line 22
Code snippet:
Router::group(function ($router) use ($router) {
$router->exceptionHandler(Handler::class);

Router::group(function ($differentVariableName) use ($router) {
$innerRouter = $router; // Assign the value of $router to $innerRouter
$innerRouter->middleware(Simcify\Middleware\Authenticate::class);
});

});

I tried to change the parameter name, but still getting the same error. Please assist. Thank you in advance
 
Back
Top