Why cannot I use the _ autoload () step in php5?

Source: Internet
Author: User
Why can't the _ autoload () method in php5 be used? use include_once (& quot ;... & quot;); in this way, if there are too many referenced classes, it is easy to forget to include a class, so I want to use the _ autoload () method, but when I write function _ autoload () {} indicates an error (a green line is drawn under _ autoload (), indicating that this method does not exist ). Why can't I use the _ autoload () method in php5?
Every time de_once ("...") is used on the page, if there are too many referenced classes, it is easy to forget to include a class, so I want to use the _ autoload () method,

However, when I write function _ autoload () {}, an error is returned (a green line is drawn under _ autoload (), indicating that this method does not exist ).

My IDE is jetBrains PhpStorm4.0.1 (I don't know if this is affected)

Don't understand, solve ....

------ Solution --------------------
Your code is correct. if the editor reports an error for _ autoload, it means that your php is not more than 5.0, or the editor's dictionary is too old.
------ Solution --------------------
Include_once ($ class. ". php"); // write the current path in this way.
------ Solution --------------------
Oh, that's right, phpstorm.

There is a green underline below, which does not prompt you for a problem, but prompts you that there is a problem with this word. when you move the mouse up, there will be two lines of selection operation, add the word to the dictionary.

Typo: Save "xxxx" to dic ....

It's a small bug in phpstorm.
------ Solution --------------------
Function _ autoload ($ class ){
Include_once ("path". $ class. ". php ");
}
Wrong. change to include_once ("path/". $ class. ". php ");

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.