if (file = = ") What this code is intended for, and when the file will be empty

Source: Internet
Author: User
There is such a code in the init.php file in Ecshop

if (__file__ = = ")//This line does not want to understand, is it necessary to write, the absolute path of the current file under what circumstances will be empty??
{
Die (' Fatal error code:0 ');
}


Reply to discussion (solution)

__FILE__ indicates the filename of the current file
Impossible to Empty



It should have been his intention to write that, but he didn't want to know why he wrote it.

__FILE__ indicates the filename of the current file
Impossible to Empty



Ecshop should not write such a sentence for no reason, I think there should be any necessity


The file name may also be empty

If you have to say what the situation is empty you change its value to empty, then it will not be empty, unless you can not change

If you have to say what the situation is empty you change its value to empty, then it will not be empty, unless you can not change

Magic constants should not be assigned to the value of it, you said the file name to change the empty bar


The file name may also be empty

It could be a path.


The file name may also be empty

It is also possible to judge whether __file__ exists, that is, compatibility judgments, but it does not feel like this is necessary, __file__ early PHP version has
  • Related Article

    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.