我收到以下错误,我似乎无法弄清楚为什么或如何触发它。
Fatal error: Cannot access empty property in /home/content/p/l/a/plai1870/html/com/php/Bone/Compiler.php on line 18
第 18 行是
throw new LogicException($this->$compilers[$language]." is not a supported compiler.");
这是编译器.php
<?php
namespace Bone;
use LogicException;
class Compiler implements \Bone\Interfaces\Compiler {
protected $compiler;
protected $compilers = array(
"php" => "PHP",
"as3" => "ActionScript3",
"javascript" => "Javascript"
);
public function __construct($language) {
$language = strtolower($language);
if (!isset($this->$compilers[$language])) {
throw new LogicException($this->$compilers[$language]." is not a supported compiler.");
}
$compiler = "\Bone\Compilers\\".$this->$compilers[$language]."\Compiler";
$this->compiler = new $compiler();
}
public function buildDefinition($object, $path = null) {
return $this->compiler()->buildInterface($object, $path);
}
public function buildObject($object, $path = null) {
return $this->compiler->buildObject($object, $path);
}
public function parameters($method) {
return;
}
public function save($data, $path) {
return;
}
}
?>
编辑 我打电话给它:
$compiler = new \Bone\Compiler("php");