定義済みの定数を別の関数で参照しようとしています。 私が得ているエラーは、定義されていない変数と、各FOOとBARの定数として定義された変数を参照しています。 class Boo {
public function runScare() {
$this->nowScaring('FOO');
$this->nowScaring('BAR');
}
private func
私は多くのプライベート変数を持つ次のクラスを持っています。 class plantOfTheMonth {
//Declare which centre(s) are being used
private $centre = "";
//Declare the attributes of the current Plant Of The Month
private $name = ""
私はクラスをインスタンス化して1行でphpの魔法をやろうとしていますが、パーサーは私を許しません。例: class Test{
private $foo;
public function __construct($value){
$this->foo = $value;
}
public function Bar(){ echo $this->
変数変数を使って何かをしようとしていますが、オブジェクトの問題に悩まされています。このクラスのセットアップを想像してみて: class A
{
public $field = 10;
}
class B
{
public $a;
public function __construct()
{
$this->a = new A();