PHP Inheritance cannot find a class problem?

Source: Internet
Author: User
Keywords Php

No error.

    
   
    

这样也不会报错

 

当然你这样是不会报错了

 

这样就会报错 Class B Not found

 

这是我在手册上看一个歪果仁写的一段 真是醉了 为什么

Reply content:

No error.

    
   
       

这样也不会报错

 

当然你这样是不会报错了

 

这样就会报错 Class B Not found

 

这是我在手册上看一个歪果仁写的一段 真是醉了 为什么

is estimated to be a bug.

 !--? phpclass A extends B{}class B extends c{}   
p> After writing is the same, the test result is a to find B, found that B depends on C, and then C does not exist directly error and did not continue to try to find the statement.

can refer to the following code

  !--? phpclass C extends D {}class A extends B{}class b extends C{}class d{}   

still will be reported that B cannot find, although C has been correctly declared.
The bug can be described as not being able to handle inheritance between classes well when declaring multiple classes in a single file, but this bug is worthless.

  • 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.