//namespace1.php name; } }
//namespace2.php name; } }
The problem is why the following error occurs when I access namespace2.php
Fatal error: Cannot declare class Demo2\test1 because the name is already in use in
Do I have to give the class an alias when using Demo1\test1? ? 'as D1test1'????
Please guide me
1 answers
The test1 class already exists in demo1. Then you applied the file require('namespace1.php'); and then referenced the demo1 class use Demo1\test1;
Do you think there will be no error? Can you give him an alias?
This is what I'm confused about. I mainly watched peter_zhu's video and it succeeded without setting an alias. I was confused for several days.
Hot tools Tags
Hot Questions
Popular tool
vc9-vc14 (32+64 bit) runtime library collection (link below)
Download the collection of runtime libraries required for phpStudy installation
VC9 32-bit
VC9 32-bit phpstudy integrated installation environment runtime library
PHP programmer toolbox full version
Programmer Toolbox v1.0 PHP Integrated Environment
VC11 32-bit
VC11 32-bit phpstudy integrated installation environment runtime library
SublimeText3 Chinese version
Chinese version, very easy to use
Hot Topics
20417
7
13577
4






