On Sun, Jan 11, 2009 at 1:34 PM, Hans Zaunere <li...@zaunere.com> wrote:

>> $foo = new Bar();
>> $a = 'my_method';
>> $result = $foo->{$a}();
>>
>> Very useful sometimes.
>
> Yes, but indirection can easily be overused.  Please don't overuse as it
> makes reading other's code that much harder.
>

Hah, just imagining a project from hell that would define() all of the
method names in an include and then make calls like the following:

$result = $foo->{ MY_METHOD_1 }();

... because then if the foo interface ever changes, all you have to do
is update the include file. :-D
_______________________________________________
New York PHP User Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/show_participation.php

Reply via email to