【发布时间】:2019-04-30 09:43:03
【问题描述】:
当尝试执行 .net 类的重载方法时,我总是收到参数数量不正确的错误。
.net 代码:
public bool AddStock(double AWidth, double AHeight, int aCount)
{
return this.Manager.(AWidth, AHeight, aCount, string.Empty, 0);
}
public bool AddStock(double AWidth, double AHeight, int aCount, string aID)
{
return this.Manager.(AWidth, AHeight, aCount, aID, 0);
}
public bool AddStock(double AWidth, double AHeight)
{
return this.AddStock(AWidth, AHeight, 1);
}
在 PHP 中:
这行得通:
$e->AddStock(2440, 1220, 1);
这不是:
$e->AddStock(2440, 1220, 1, 'Test');
致命错误:未捕获的 com_exception:错误 [0x8002000e] 参数数量无效。
【问题讨论】:
标签: php .net overloading