PHP : What is the benefit of spl_autoload_register? Performance of includes

Viewed 3988

I've been reading about spl_autoload_register functions as a substitution of require, require_once, include, & include_once. Although there is much discussion about how to implement this, the documentation isn't too detailed and there isn't an explaination as to how it would be beneficial vs the original ways.

Reference : http://php.net/manual/en/function.spl-autoload-register.php

I am wondering how spl_autoload_register works?

Is there a performance difference when using spl_autoload_register?

How does it handle many require statements (more than 20) in cross linked classes? (Wouldn't this still result in duplicate requires?)

1 Answers
Related