PHP spl_autoload

后端 未结 3 1722
借酒劲吻你
借酒劲吻你 2021-01-05 14:24

i dont really get the docs for spl_autoload

bool spl_autoload_register  ([ callback $autoload_function  ] )

from my understanding, it will

3条回答
  •  离开以前
    2021-01-05 15:13

    What say is correct. It's called when an unknown class is instantiated. You then get the chance to include/require the necessary file.

    When the function resides in a class, you have to pass in an array. In this case it's a static function because they pass in the Doctrine class instead of an instance of the Doctrine class.

提交回复
热议问题