From 834e16aacc479f1afcc2c4c0b726d670584afc16 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Mon, 14 Apr 2014 21:36:34 -0700 Subject: [PATCH] Add a comment about __call / is_callable Fixes #199 --- src/Mustache/Context.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Mustache/Context.php b/src/Mustache/Context.php index 1966d25..fe25692 100644 --- a/src/Mustache/Context.php +++ b/src/Mustache/Context.php @@ -134,6 +134,9 @@ class Mustache_Context { for ($i = count($stack) - 1; $i >= 0; $i--) { 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)) { return $stack[$i]->$id(); } elseif (isset($stack[$i]->$id)) {