Why PHP class does not return `

404

Not found

`? 请求翻译

Why PHP class does not return

404

Not found

?

class checkid{
    public $title;
    public $content;
    function status(){
        $this->title='404';
        $this->content='Not found';
    }
}
$checkid=new checkid($url);
//$id=0;
((isset($id)) ? '' : $checkid->status().$title=$checkid->title.$content=$checkid->content);
//Why it does not return `

404

Not found

`? echo "

$title

$content

";

Update: I know well to do it trough

if(isset($id)){}else{
    $checkid->status();
    $title=$checkid->title;
    $content=$checkid->content);
}

but I was worndering if it is possible to make it trough using

((isset($id)) ? '' : $checkid->status().$title=$checkid->title/*here $content break it down*//*.$content=$checkid->content*/);

4个回答