php - class variable functions -
say $this->varname
equal string is_callable()
returns true. call i'd have $temp = $this->varname; $temp();
or... there way call without having create 2 lines?
the problem doing $temp = $this->varname()
that'll try call method within class called varname() - won't call function @ $this->varname.
thanks!
you have or use call_user_func(_array)
. or anthony has suggested me on internals (http://www.mail-archive.com/internals@lists.php.net/msg64647.html) can ${'_'.!$_=$this->varname}();
.
there exists pull request php being discussed on internals: https://github.com/php/php-src/pull/301 (and rfc https://wiki.php.net/rfc/fcallfcall)
Comments
Post a Comment