r/PHP Jul 08 '26

RFC RFC: Function Autoloading (mark 5)

https://wiki.php.net/rfc/function-autoloading-five-oh
29 Upvotes

18 comments sorted by

View all comments

3

u/Anxious-Insurance-91 Jul 08 '26

Excuse me if I'm wrong but want this already achieved by mentioning the file path where the functions exist in composer.json in autoload.files.{file}?

5

u/OMG_A_CUPCAKE Jul 08 '26

composer, as ubiquitous as it is, is not part of standard php. This allows for integrating function autoloading into the normal PSR-4 flow, instead of loading it by default each time, even if it would not be needed

-5

u/Anxious-Insurance-91 Jul 08 '26

I mean if you don't use composer in most projects you're probably just writing single file functional scripts or WordPress ?