RE: [PHP-PEAR] variable method names
[email protected] ("Aaron Gardner")
| Newsgroups | php.pear |
|---|---|
| Message-ID | <[email protected]> |
I think calling variable methods with the braces:
$this->{$method}($value);
is better than without:
$this->$method($value);
It's too easy to overlook the dollar sign when there are no braces around
the variable. Also, a lot of beginning PHP programmers that I've worked with
take some time to get comfortable with dollar signs when dealing with
objects, so the braces help signal that the variable method name is indeed
intentional. In short, I find that braces make debugging easier.
That said, I'm speaking of PHP style in general. I'm not sure if there are
PEAR style rules on this issue.
Aaron
Web Developer
yourfit.com