Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
112 views
in Technique[技术] by (71.8m points)

php - is there a way to have a namespace with a space in it?

One of the directories in my app has the name web services. For the classes contained in that folder I have tried declaring the namespace various ways, including:

namespace web services;
namespace 'web services';
namespace [web services];
namespace {web services};

...none of which work. VS Code gives warnings on each of these.

The multitude of online documentation/forum posts/blogs regarding PHP namespaces do not mention anything about whether or not spaces are allowed; though all of the examples they show do not have any namespaces that contain spaces. Is it possible for a namespace to contain a space so it matches the app's directory structure?

PHP 7.4.13 is being used for this app.

question from:https://stackoverflow.com/questions/65948006/is-there-a-way-to-have-a-namespace-with-a-space-in-it

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...