5 ms·
> PHP in theory has namespaces, but the standard libraries are just dumped in global. Modern PHP development almost exclusively uses Composer libraries rather
by CiPHPerCoder 9y ago
> PHP in theory has namespaces, but the standard libraries are just dumped in global.
Modern PHP development almost exclusively uses Composer libraries rather than the standard libraries, which overwhelmingly use namespaces in Vendor\Project format.
There's going to be a push to clean up the standard library in the coming years. The plan is to introduce a namespaced alternative to the standard library in the global namespace which also cleans up a lot of nits (e.g. phpsadness.com posts). Maybe in PHP 8? Then when the ecosystem catches up, we can discuss deprecating/removing the "just dumped in global" way of doing things in PHP 9.
Source: I'm very likely going to be the main person driving this push.
- mdhughes 9y agoNamespaces by 2020? That'd be nice. The \ syntax still makes my eyes bleed a bit, when most others use . or :
- CiPHPerCoder 9y agoYou might want to go see a doctor and get that checked out then. Just because "most others use . or :" doesn't mean it's the only correct syntax in the realm of possibility.
- emodendroket 9y agoI think there's some reason they landed on that one, but seriously, if that's your biggest complaint about the language...
- emodendroket 9y agoI've posted this before but I've really been pleasantly surprised by how good working in PHP7 is. It's not my favorite but I certainly like it more than Ruby.