复制代码 代码如下:
<?php
class b{
function test(){
myImport("a.php");
$testClass = new impClass();
$testClass->test();
echo $a."from b";
}
}
class a{
function funa(){
$InsB = new b();
$InsB->test();
}
}
function myImport($file){
require $file;
echo $a."from myImport";
}
$InsA = new a();
$InsA->funa();
?>
a.php
<?php
$a = "a";
class impClass{
function test(){
echo "import success";
}
}
?>
新闻热点
疑难解答