Answer the question
In order to leave comments, you need to log in
Why doesn't it find the namespace class?
there is an index.php file and Parser.php is on the same level with it,
here is the index code
require_once "vendor/autoload.php";
use src\Parser;
$parser = new Parser();
Fatal error: Uncaught Error: Class 'src\Parser' not found
{
"require": {
"phpoffice/phpspreadsheet": "^1.2"
},
"autoload": {
"psr-4": {"excel.local": "/"}
}
}
Answer the question
In order to leave comments, you need to log in
there is an index.php file and Parser.php is on the same level with it
Then it should lie in src/Parser.php, and not at the same level.
https://www.php-fig.org/psr/psr-4/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question