diff --git a/lib/Twig/Environment.php b/lib/Twig/Environment.php index 49816ed9d..4c4091614 100644 --- a/lib/Twig/Environment.php +++ b/lib/Twig/Environment.php @@ -263,6 +263,10 @@ class Twig_Environment } elseif (false === $cache) { $this->originalCache = $cache; $this->cache = new Twig_Cache_Null(); + } elseif (null === $cache) { + @trigger_error('Using "null" as the cache strategy is deprecated and will be removed in Twig 2.0.', E_USER_DEPRECATED); + $this->originalCache = false; + $this->cache = new Twig_Cache_Null(); } elseif ($cache instanceof Twig_CacheInterface) { $this->originalCache = $this->cache = $cache; } else {