NYCPHP Meetup

NYPHP.org

[nycphp-talk] function references

Hans Zaunere lists at zaunere.com
Sun Jan 11 13:34:36 EST 2009


> > Sweet so, I think
> >
> > $a = 'my_func';
> >
> > does it for me.
> 
> Also works with properties and methods of objects:
> 
> $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.

H





More information about the talk mailing list