Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



It 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.


That is not valid PHP code.

Try making a working example of it on an active codebin like this one:

https://www.online-ide.com/

And link to it, then we can discuss it.


It 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.


Thats does not work without a third party dependency (composer). You cant load functions like that in vanilla PHP.




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

Search: