Why does the HTTP500 error occur when spl_autoload_register is used?

Source: Internet
Author: User
I am a student at the school. PHP has just finished learning the object-oriented part. I am currently understanding how to use the learning SPL library. I found that some of the SPL parts are still hard to understand, the root directory of the learning project is as follows... I also hope you give pointers to one or two PSR-0 ── App │ ── Controller │ └... I am a student at the school. PHP has just finished learning the object-oriented part. I am currently understanding how to use the learning SPL library. I found that some of the SPL parts are still hard to understand, the root directory of the learning project is as follows... hope you can give me some advice.

PSR-0
── App
│ ── Controller
│ ── Home
│ ── Revamp. php
── Users
│ ── Loader. php
│ ── Object. php
── Index. php

The loading class is as follows:Loader. php


  

Revamp.php


   

The entry file is as follows:Index. php:


    

Why is there a problem with loading the second Revamp class? HTTP500 Error

Reply content:

I am a student at the school. PHP has just finished learning the object-oriented part. I am currently understanding how to use the learning SPL library. I found that some of the SPL parts are still hard to understand, the root directory of the learning project is as follows... hope you can give me some advice.

PSR-0
── App
│ ── Controller
│ ── Home
│ ── Revamp. php
── Users
│ ── Loader. php
│ ── Object. php
── Index. php

The loading class is as follows:Loader. php


     

Revamp.php


      

The entry file is as follows:Index. php:


       

Why is there a problem with loading the second Revamp class? HTTP500 Error

Open the error display to see what the specific error is. It is estimated that this situation is related to the processing of ClassName. Note that there is a slash before the class name.

View the directory structure you sent. The Controller and Home are placed at the same level.

I tried your code and did not make any changes. It can be output normally ~

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.