私はUbuntu 11.10です。私がecho phpinfo();
のような単純なスクリプトを書くと、エラーは表示されません。しかし、私はいくつかの追加のPHPコードをブラウザサーバーエラーページを記述しようとすると。ここで私は理解できない問題は何ですか?ubuntu 11.10のPHPサーバーエラー
コードを次のように変更すると、サーバーエラーが発生します。
<?php
class MyClass{
private $prop;
public function __construct(){
echo "The class \"".__CLASS__."\"was created";
}
public function __destruct(){
echo "The class \"".__CLASS__."\" was destroyed";
}
protected function getProperty(){
return $prop;
}
public function __toString(){
echo "__toString() method called.<br />";
return $this->getProperty().'<br />';
}
public function setProperty($prop){
$this->prop = $prop;
}
}
class MyOtherClass extends MyClass{
public function __construct(){
parent::__contruct();
echo "A new constructor in class \"".__CLASS__"\"";
}
public function newMethod(){
echo 'From a new method in class '.__CLASS__.'<br />';
}
}
$newClass = new MyOtherClass();
echo $newClass->getProperty();
?>
コードサンプルを提供してください。 – Mike
質問を編集しました... – Sandeep
Sever Errorとは何ですか? – Shad