bug #2272 Fix unconsistent behavior with "get" and "is" (wolfx)

This PR was squashed before being merged into the 1.x branch (closes #2272).

Discussion
----------

Fix unconsistent behavior with "get"  and "is"

Commits
-------

8fb35d5 Fix unconsistent behavior with "get"  and "is"
This commit is contained in:
Fabien Potencier
2016-11-21 17:03:53 -08:00
+3
View File
@@ -604,6 +604,9 @@ abstract class Twig_Template implements Twig_TemplateInterface
} else {
$methods = get_class_methods($object);
}
// sort values to have consistent behavior, so that "get" methods win precedence over "is" methods
sort($methods);
$cache = array();
foreach ($methods as $method) {