Update of "FeatureComparison"
Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.
Let me just preface this with: inconclusive conventions are better than no standards at all. And there's probably nothing newsworthy here.
Due to the ellipses in the PSR-x documents it's however helpful to detail some technical deviations and oversights.
|Multiple class declarations per script||✔||✘ ¹||✘ ¹||✔|
|Multiple namespaces per file||✔||✘||✘||✔|
|Specific underscore treatment||✘||✔||✘||✘|
|Case-insensitive class identifiers ²||✔||✘||✘ ²||✔|
|Phar package support||✔||✘ ³||✘||✔|
|Versioned bundles ⁴||✔||✘||✘||✘|
- Impractical, but symlinking dependency-conjoined class modules might be a feasible workaround.
- Not just accidentally on some plattforms or filesystems.
- While prohibited, most PSR-0 autoloaders work with handicrafted phar:// paths in their namespace registry.
- Not a discreet PHP or Phar feature, and resolving dependencies is certainly still best left with composer, not done at runtime.
Origin of PSR-0/4
PSR-4 inherits the PSR-0 design as intended for and from PHP framework maintainers. Retaining the traditional class directory structures was the protogenic goal then. PSR-4 constitutively just removed the PEAR-style name splitting.
Which is where the plattform ambiguity due to absent identifier-to-file case normalization issues from. Holding on to the handed down file structuring schemes is also why namespaces were interpreted as PHP 5.3s only significant addition, but Phar support disregarded.
Composer is married to PSR-0/4. Technically it's not a dependency, as highlighted by Composers very own classmap generator. (Which however infers the shallow semantics of singly-namespaced-class-per-file, invalid identifier mapping, zilch phar support).
Divorcing your way out of an abusive marriage is no small feat. Yet composer may keep the kids. When extracting packages, it's neither out of the picture to apply some common sense and
strtolower, or repackage coherent bundles into phars. Thus development sources still may follow any of the framework guidelines, yet be used unambiguously cross-plattform.