◆ 允许的方法签名 -允许真正的方法签名,所以程序员可以有不同的参数列表或返回类型的同名方法。
class A {
public int function doSomething(int $a, float $b) {
// Same as $a->*($b->to_int());
int $c = $a * $b->to_int();
return $c;
}
public float function doSomething(int $a, float $b, float $c) {
// Same as calling $a->*($b->*($c)); since * is a method on each object $a and $b.
float $d = $a * $b * $c;
return $d;
}
}