Is it bad to include a lot of files in PHP like it is for file based Sessions?

后端 未结 7 990
遇见更好的自我
遇见更好的自我 2021-01-04 14:25

After reading about how file based PHP sessions are not the greatest for performance, it has me thinking. Does this mean a PHP script including a lot of files is bad as wel

7条回答
  •  無奈伤痛
    2021-01-04 14:49

    Another option is to "lazy" include files, eg, require_once them before using them (example instantiating a class) so that a whole load of unused includes won't (kind of) happen.

    I've used a Zend feature about this (register autoload) but I do not know if it is generic to php or if it is not but exists to other frameworks...

提交回复
热议问题