Fix unconsistent behavior with "get" and "is"

This commit is contained in:
Cyril PERROT
2016-11-21 14:45:14 +01:00
committed by Fabien Potencier
parent ed6e8972ac
commit 8fb35d5fd4
+3
View File
@@ -604,6 +604,9 @@ abstract class Twig_Template implements Twig_TemplateInterface
} else { } else {
$methods = get_class_methods($object); $methods = get_class_methods($object);
} }
// sort values to have consistent behavior, so that "get" methods win precedence over "is" methods
sort($methods);
$cache = array(); $cache = array();
foreach ($methods as $method) { foreach ($methods as $method) {