Issue #3328457 by xjm, dimitriskr: Replace most substr($a, $i) where $i is negative with str_ends_with()