I've tried to access a function in a class private array, but i've got an error:
Parse error: syntax error, unexpected '(', expecting ')' in CODE on line 17 Errors parsing CODE
this is my code:
<?php
function foo_function () {
return 'foo_value';
}
class foo {
private $good_foo_var = array (
'foo_key' => 'anything'
);
private $bad_foo_var = array (
'foo_key' => foo_function ()
);
public function get_the_foo () {
return $this -> foo_var['foo_key'];
}
}
I have no idea why. Outside a class this kind of assignment is no problem.