Hacker News new | past | comments | ask | show | jobs | submit login

Problem is that it can’t be done in PHP without on-the-fly rewriting of source files.

In JavaScript the caller decide how a module should be used by importing it to symbol, thus different versions of the same library can exist simultaneously.

In PHP it is the callee that decides how to be imported because of namespaces.

One and only one class with that exact name and namespace can exist at a given time, thus different versions of the same library can’t be loaded simultaneously.

That is why modules are far superior over namespaces.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: