PHP namespace instance description

Source: Internet
Author: User
PHP namespace instance description. For more information, see.

PHP namespace instance description. For more information, see.

The Code is as follows:


Namespace bak \ ba;
Function bab (){
Echo "bi ";
}
Namespace kkk;
Function k1 (){
Echo "k1 ";
}
\ Bak \ ba \ bab (); // use another namespace in the kkk namespace. Pay attention to the previous \
Use \ bak \ ba as B; // It is still in the kkk namespace, but the following method is correct when using an alias
# Use bak \ ba as B; // do not use the \ ID
B \ bab (); // when the namespace under the alias is used, the \ ID should not exist before it
K1 (); // No error is returned when this function is called, indicating that use does not affect the current namespace

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.