4 ms·
I think you’re being a bit disingenuous here. Almost all packages are vendor and package prefixed yes, but your own code from very easily be as simple as: name
by Dachande663 2y ago
I think you’re being a bit disingenuous here. Almost all packages are vendor and package prefixed yes, but your own code from very easily be as simple as:
namespace Me;
function test(){}
———
use function Me\test;
test();
Conflicting package names require you to be working on a very poorly written project (not using PSR-1) or a dependency that is even worse which is fewer and further between since composer.
- TekMol 2y agoThat is not valid PHP code. Try making a working example of it on an active codebin like this one: https://www.online-ide.com/ https://www.online-ide.com/ And link to it, then we can discuss it.
- Dachande663 2y agoIt is valid. I’m running 8.4 and with autoloading etc it all works as expected. Maybe the language you’re arguing against isn’t the same language anymore.
- phplovesong 2y agoThats does not work without a third party dependency (composer). You cant load functions like that in vanilla PHP.
- tored 2y agoIt becomes a problem if you want to use multiple versions of the same library, which may happen if you are using composer, e.g two different dependencies uses the same dependency but different major releases.