<?php
class Result{
private $shape=null;
function __construct()
{
$this->shape=new $_GET['action']();
}
function __toString(){
$result=$this->shape->shapeName.'的周长:'.round($this->shape->perimoter(),2).'<br>';
$result.=$this->shape->shapeName.'的面积:'.round($this->shape->area(),2).'<br>';
return $result;
}
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号