PHP严格的标准:什么';这个代码错了


PHP Strict standards: what's wrong with this code?

可能重复:
为什么PHP 5.2+不允许抽象静态类方法
为什么可以';你不是从PHP中的抽象类调用抽象函数吗?

我在PHP 5.3.8:上运行此代码

abstract class Geometry
{
    abstract public static function fromArray(array $array);
}
class Point extends Geometry
{
    public static function fromArray(array $point)
    {
        return new self($point[0], $point[1]);
    }
}

并收到以下错误:

严格标准:静态函数Geometry::fromArray((不应是抽象

  • 这种方法有什么问题
  • 有什么可行的替代方案可以强制具体类实现这种工厂方法

你能让Geometry成为一个接口,并让Point实现它吗?