require_once()
has two problems, if you ignore the performance problem, the second is important. If you use require_once()
, it means that you can require
use the same file more than once. This is essentially an incorrect or erroneous design. Now, part of the performance for a web-optimized application will do nothing. If you understand that serving a static HTML file or cached content is faster than serving a PHP file, you will understand why people say using require_once()
is slower.
Kumar source share