Results 1 to 25 of 50
May 22, 2012, 06:02 #1
- Join Date
- Jan 2005
- 0 Post(s)
- 0 Thread(s)
$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;
$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;