class abc
{
function __construct()
{
$num =func_num_args();
switch ($num)
{
case 0:
echo "none ";
break;
case 1:
echo "one ";
break;
case 2:
echo "two ";
break;
}
}
}
new abc() ;
new abc(1) ;
new abc(1,2);
函数的解析我就不写了,太简单了