$obj()->var syntax for accessors?
I have an object which consists only in setters and getters methods. All the setters are called upon instantiation. Then it's all about using the getters.
I was wondering if it would acceptable to do that:
$foo = $object->get()->foo;
1. Is there any advantage? I somewhow find the syntax cleaner.
$foo = $object->getFoo();
2. How would the internal of the object work to reach the first syntax?
3. Would there be a third, even shorter, syntax possible?
$foo = $object()->foo;