strategy=$strategy;
    }
    //得到具体算法的结果
    public function getResult(){
        $this->strategy->AlgorithmInterface();
    }
}
//上下文类——改进版
class ContextImprove{
    public static function getResult($Algorithm){
        $str='ConcreteStrategy'.$Algorithm;
        $alg=new ReflectionClass($str);
        return $alg->newInstance()->AlgorithmInterface();
    }
}


//客户端
$context=new Context(new ConcreteStrategyA());
$context->getResult();

echo '
'; //客户端——改进版 echo ContextImprove::getResult('A');