Skip to content

Commit

Permalink
bug #2272 Fix unconsistent behavior with "get" and "is" (wolfx)
Browse files Browse the repository at this point in the history
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"
  • Loading branch information
fabpot committed Nov 22, 2016
2 parents 9fce825 + 8fb35d5 commit e7aa8e5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Twig/Template.php
Expand Up @@ -604,6 +604,9 @@ protected function getAttribute($object, $item, array $arguments = array(), $typ
} 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) {
Expand Down

0 comments on commit e7aa8e5

Please sign in to comment.