Reputation: 393
I have a structure like so:
index.php
core
Exceptions
ExceptionCore.php
ExceptionUtil.php
Vendor
autoload stuff
Index file:
<?php
require 'vendor/autoload.php';
new \core\Exceptions\ExceptionCore\ExceptionCore();
ExceptionCore:
<?php
Namespace core\Exceptions\ExceptionCore;
Class ExceptionCore
{
public function __construct()
{
echo 'fffhf';
}
}
But I am getting the error:
Fatal error: Uncaught Error: Class 'core\Exceptions\ExceptionCore\ExceptionCore' not found in C:\xampp\htdocs\user\index.php:5 Stack trace: #0 {main} thrown in C:\xampp\htdocs\user\index.php on line 5
Upvotes: 1
Views: 1594
Reputation: 44
index file
<?php
require 'vendor/autoload.php';
new core\Exceptions\ExceptionCore\ExceptionCore(); // / delete
ExceptionCore:
Namespace core\Exceptions\ExceptionCore;
Class ExceptionCore
{
public function __construct()
{
echo 'fffhf';
}
}
Upvotes: 0