What is the difference between automatic loading and Automatic Registration loading?

Source: Internet
Author: User
Please answer in detail.

Reply content:

Please answer in detail

Registering and loading is a function or method. When the program does not find a class, it will first access this method to load the corresponding class to the program according to its own rules.
The registration of automatic loading tells PHP which automatic loading method will be used, so that PHP will know which method to call for loading if no class is found.

You need to complete an automatic loading method, and then register the automatic method to tell PHP to call this method when the class cannot be found.
When registering the autoload method, you only need to input a callable resource, and the method or function accepts at most one required parameter.
That is to say, You need to implement an automatic loading method and then call spl_autoload_register (callable) to register it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.