PHP namespace example description_PHP tutorial

WBOY
Release: 2016-07-21 15:32:36
Original
877 people have browsed it

Copy code The code is as follows:

namespace bakbaba;
function bab(){
echo "bi";
}
namespace kkk;
function k1(){
echo "k1";
}
bakbababab();//Use other namespaces under the kkk namespace, please note The previous
use bakbaba as b;//is still in the kkk namespace, but the following method is also correct when using an alias
#use bakbaba as b;//you don’t need to use the number
bbab in the front ();//When using a namespace under an alias, there should be no number in front of it
k1();//No error is reported when calling this function, indicating that use does not affect the current namespace

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/322793.htmlTechArticleCopy the code as follows: namespace bakbaba; function bab(){ echo "bi"; } namespace kkk; function k1 (){ echo "k1"; } bakbababab();//Use other namespaces under the kkk namespace...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template