public static function toString($levels, $spvar, $var) {
        return ($spvar ? '@' : '') . str_repeat('../', $levels) . ((is_array($var) && count($var)) ? implode('.', array_map(function($v) {
            return ($v === null) ? 'this' : "[$v]";
        }, $var)) : 'this');
    }
public static function toString($levels, $spvar, $var) {
        return ($spvar ? '@' : '') . str_repeat('../', $levels) . ((is_array($var) && count($var)) ? implode('.', array_map(function($v) {
            return ($v === null) ? 'this' : "[$v]";
        }, $var)) : 'this');
    }
public static function toString ( $ levels , $ spvar , $ var ) { return ( $ spvar ? '@' : '' ) . str_repeat ( '../' , $ levels ) . ( ( is_array ( $ var ) && count ( $ var ) ) ? implode ( '.' , array_map ( function ( $ v ) { return ( $ v === null ) ? 'this' : "[$v]" ; } , $ var ) ) : 'this' ) ; }
get normalized handlebars expression for a variable

@param integer $levels trace N levels top parent scope
@param boolean $spvar is the path start with @ or not
@param array<string|integer> $var variable parsed path

@return string normalized expression for debug display

@expect '[a].[b]' when input 0, false, array('a', 'b')
@expect '@[root]' when input 0, true, array('root')
@expect 'this' when input 0, false, null
@expect 'this.[id]' when input 0, false, array(null, 'id')
@expect '@[root].[a].[b]' when input 0, true, array('root', 'a', 'b')
@expect '../../[a].[b]' when input 2, false, array('a', 'b')
@expect '../[a\'b]' when input 1, false, array('a\'b')
get normalized handlebars expression for a variable