Selaa lähdekoodia

Add a comment about __call / is_callable

Fixes #199
Justin Hileman 11 vuotta sitten
vanhempi
sitoutus
834e16aacc
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      src/Mustache/Context.php

+ 3 - 0
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)) {