We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 647758e commit cbd5c4aCopy full SHA for cbd5c4a
3/zend_autoload.md
@@ -0,0 +1,7 @@
1
+### 3.4.7 类的自动加载
2
+在实际使用中,通常会把一个类定义在一个文件中,然后使用时include加载进来,这样就带来一个问题:在每个文件的头部都需要包含一个长长的include列表,而且当文件名称修改时也需要把每个引用的地方都改一遍,另外前面我们也介绍过,原则上父类需要在子类定义之前定义,当存在大量类时很难得到保证,因此PHP提供了一种类的自动加载机制,当使用未被定义的类时自动调用类加载器将类加载进来,从而实现类加载的统一化。
3
+
4
+PHP中提供了两种方式实现自动加载:__autoload()、spl_autoload_register()。
5
6
7
0 commit comments