PHP – most lightweight psr-0 compliant autoloader

You ask extremely lightweight, let’s do so 😉 Timothy Boronczyk wrote a nice minimal SPL autoloader : http://zaemis.blogspot.fr/2012/05/writing-minimal-psr-0-autoloader.html I condensed the code like this: function autoload1( $class ) { preg_match(‘/^(.+)?([^\\\\]+)$/U’, ltrim( $class, ‘\\’ ), $match ) ); require str_replace( ‘\\’, “https://stackoverflow.com/”, $match[ 1 ] ) . str_replace( [ ‘\\’, ‘_’ ], “https://stackoverflow.com/”, $match[ 2 ] … Read more