<?php
class mc {
function mcmsg(){
echo "mc::mcmsg() !" .PHP_EOL;
}
function mcget(){
return new nc();
}
}
class nc {
function ncget(){
return new mc();
}
function ncmsg(){
echo "nc::ncmsg() !" .PHP_EOL;
}
}
$m = new mc();
$m -> mcget() ->ncmsg();
$m -> mcget() -> ncget() -> mcget() -> ncget() -> mcmsg();
?>
本文由 lnlidawei 原创、整理、转载,本文来自于【博客园】; 整理和转载的文章的版权归属于【原创作者】; 转载或引用时请【保留文章的来源信息】:https://www.cnblogs.com/lnlidawei/p/15583311.html