Add a comment about __call / is_callable

Fixes #199
This commit is contained in:
Justin Hileman
2014-04-14 21:36:56 -07:00
parent 4c83fb0147
commit 834e16aacc
+3
View File
@@ -134,6 +134,9 @@ class Mustache_Context
{ {
for ($i = count($stack) - 1; $i >= 0; $i--) { for ($i = count($stack) - 1; $i >= 0; $i--) {
if (is_object($stack[$i]) && !($stack[$i] instanceof Closure)) { if (is_object($stack[$i]) && !($stack[$i] instanceof Closure)) {
// Note that is_callable() *will not work here*
// See https://github.com/bobthecow/mustache.php/wiki/Magic-Methods
if (method_exists($stack[$i], $id)) { if (method_exists($stack[$i], $id)) {
return $stack[$i]->$id(); return $stack[$i]->$id();
} elseif (isset($stack[$i]->$id)) { } elseif (isset($stack[$i]->$id)) {