- Output for 5.5.24 - 5.5.31, 5.6.8 - 5.6.17, 7.0.0 - 7.0.2
- Parse error: syntax error, unexpected '$test' (T_VARIABLE), expecting function (T_FUNCTION) in /in/0MUH6 on line 15
Process exited with code 255.
<?php
class test {
protected $testArr;
protected function test() {
$testObj = new stdClass();
$testObj->foo = 'foo';
$this->testArr['test'] = $testObj;
return $testObj;
}
$test = $this->test();
$test->foo = 'bar';
var_dump($this->testArr['test']);
}