name.php
<?php
include “pname.php”;
function name(){
echo “name”;
}
pname.php
<?php
function name(){
echo “pname”;
}
访问name.php 就会冲突。
解决冲突:
name.php
<?php
namespace name;
include “pname.php”;
function name(){
echo “name”;
}
name();
pname.php
<?php
namespace name\p;
function name(){
echo “pname”;
}