<?php
class shape
{
var $x,$y,$r;
function add($x,$y,$r)
{
$image=imagecreate(500,300);
$background=imagecolorallocate($image,255, 255,255);
$red=imagecolorallocate($image,255,0, 0);
imagearc($image, $x, $y, $r, $r, 0,360,$red);
header("Content-type:image/gif");
imagegif($image);
$obj->x='100';
$obj->y='100';
$obj->r='50';
echo $obj->x, $obj->y, $obj->r;
}
}
$obj=new shape;
?>
我运行了,是可以的,只不过你的代码写得让我很蛋痛