-2
実行コードは、PHP 5.3.6で実行ではなく、私は私のコードを追加しました。ここ5.1.6
class2.phpを実行class1.php
<?php
class class1
{
public function test_class(){
return "text_class";
}
}
?>
class2.php
<?php
require_once "class1.php";
class class2{
public function __construct(){
$this->classs=new class1();
}
public function test_class2(){
echo $this->classs->test_class();
return "text_class";
}
}
?>
実行はclass2.php contructor.noで停止します。エラーまたは警告は表示されません。
私はあなたが、あなたはどこでもあなたのクラスでこのプロパティを使用することができますプロパティを定義する必要があり、あなたのクラス2ファイルでPHPのバージョン5.1.6
デフォルトでエラーをキャッチして表示するようにシステムが設定されていない場合は、エラー報告http://php.net/manual/en/function.error-reporting.phpを使用してください。 –
私はクラスerror_reporting(E_ALL)のトップに含まれていますが、動作していません – sridhard
以下の回答を参照してください –