Эх сурвалжийг харах

Per the updated spec, interpolated lambdas should not be cached.

Justin Hileman 14 жил өмнө
parent
commit
14911a158e
1 өөрчлөгдсөн 1 нэмэгдсэн , 9 устгасан
  1. 1 9
      Mustache.php

+ 1 - 9
Mustache.php

@@ -72,11 +72,6 @@ class Mustache {
 
 	protected $_localPragmas = array();
 
-	/**
-	 * Interpolated lambdas should be called only once... store 'em for later here
-	 */
-	protected $_interpolatedLambdas = array();
-
 	/**
 	 * Mustache class constructor.
 	 *
@@ -614,10 +609,7 @@ class Mustache {
 
 		if ($this->_varIsCallable($val)) {
 			$key = is_object($val) ? spl_object_hash($val) : serialize($val);
-			if (!isset($this->_interpolatedLambdas[$key])) {
-				$this->_interpolatedLambdas[$key] = call_user_func($val);
-			}
-			return $this->_renderTemplate($this->_interpolatedLambdas[$key]);
+			return $this->_renderTemplate(call_user_func($val));
 		}
 
 		return $val;