search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

1 answers
Q&A Regarding the namespace problem, can any veteran please help me analyze it? I'm a noob.

0
//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

Your Answer
submit

1 answers
1

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?

2020-07-08 23:11:28

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.

小白一直白 2020-07-10 09:05:20

submit

Popular tool

vc9-vc14 (32+64 bit) runtime library collection (link below)

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

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use