/Core/Api.php
<?php namespace Core;
class Api
{
//
}
start.php
<?php
include 'vendor/autoload.php'
index.php
<?php
include 'start.php';
use Core\Api as Api;
new Api // it's work
start.php
<?php
include 'vendor/autoload.php'
use Core\Api as Api;
index.php
<?php
include 'start.php';
new Api; // Fatal error: Class 'Api' not found
There are many tool class will be used in many places, how to alias it as once in some file and let other file can use the aliased name directly?