My question is quite simple: In PHP OOP I want the value of an object property to be returned by a function. To be specific: I want a string to be translated with gettext. But it seems, that the value of a property has to be a string, a number or an array but not a function.
- Why is that so?
- Is there a solution for my need to have the value translated?
My code is similar to this:
<?php
class Bar extends Foo {
public $baz = array('lorem' => __('ipsum'));
// other code
?>