protected function _getEchoMethods()
{
$methods = ['_compileRawEchos' => strlen(stripcslashes($this->_rawTags[0])), '_compileEscapedEchos' => strlen(stripcslashes($this->_escapedTags[0]))];
uksort($methods, function ($method1, $method2) use($methods) {
// Ensure the longest tags are processed first
if ($methods[$method1] > $methods[$method2]) {
return -1;
}
if ($methods[$method1] < $methods[$method2]) {
return 1;
}
// Otherwise give preference to raw tags (assuming they've overridden)
if ($method1 === '_compileRawEchos') {
return -1;
}
if ($method2 === '_compileRawEchos') {
return 1;
}
if ($method1 === '_compileEscapedEchos') {
return -1;
}
if ($method2 === '_compileEscapedEchos') {
return 1;
}
return 0;
});
return $methods;
}